@moonshot-ai/kimi-code 0.22.2 → 0.22.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/main.mjs +671 -529
  2. package/dist-web/assets/{CodeBlockNode-CaJnX8WY.js → CodeBlockNode--K4eRmNh.js} +1 -1
  3. package/dist-web/assets/{CodeBlockShell.vue_vue_type_style_index_0_lang-BRgPQSVb.js → CodeBlockShell.vue_vue_type_style_index_0_lang-8z4SytTj.js} +1 -1
  4. package/dist-web/assets/{DesignSystemView-2XTmljim.js → DesignSystemView-gstQZ6Dp.js} +1 -1
  5. package/dist-web/assets/{Tooltip-DZguFKhz.js → Tooltip-sFOhW5c-.js} +1 -1
  6. package/dist-web/assets/{arc-DtSq864Y.js → arc-b1f-JaXG.js} +1 -1
  7. package/dist-web/assets/{architectureDiagram-3BPJPVTR-DMQz4tYy.js → architectureDiagram-3BPJPVTR-DRV073hL.js} +1 -1
  8. package/dist-web/assets/{blockDiagram-GPEHLZMM-uiDJjfXs.js → blockDiagram-GPEHLZMM-BG0TxS08.js} +1 -1
  9. package/dist-web/assets/{c4Diagram-AAUBKEIU-Dupe9n1b.js → c4Diagram-AAUBKEIU-CsocakY-.js} +1 -1
  10. package/dist-web/assets/channel-Cwe7TdNc.js +1 -0
  11. package/dist-web/assets/{chunk-2J33WTMH-CAvfdKCa.js → chunk-2J33WTMH-D7mBRhm2.js} +1 -1
  12. package/dist-web/assets/{chunk-4BX2VUAB-Bqf9QeRR.js → chunk-4BX2VUAB-BMOSnPC4.js} +1 -1
  13. package/dist-web/assets/{chunk-55IACEB6-DMDy7rWA.js → chunk-55IACEB6-DH7ZU8ec.js} +1 -1
  14. package/dist-web/assets/{chunk-727SXJPM-RW5JVWWF.js → chunk-727SXJPM-CaYu9Tne.js} +1 -1
  15. package/dist-web/assets/{chunk-AQP2D5EJ-C3cDBsoU.js → chunk-AQP2D5EJ-Dd2oKOPL.js} +1 -1
  16. package/dist-web/assets/{chunk-FMBD7UC4-P4JPvwBw.js → chunk-FMBD7UC4-JdHZqUnV.js} +1 -1
  17. package/dist-web/assets/{chunk-ND2GUHAM-CrF954Ah.js → chunk-ND2GUHAM-DBm1Ahcp.js} +1 -1
  18. package/dist-web/assets/{chunk-QZHKN3VN-Vs9ezeZH.js → chunk-QZHKN3VN-DmqufK50.js} +1 -1
  19. package/dist-web/assets/classDiagram-4FO5ZUOK-CQ4_AXuT.js +1 -0
  20. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-CQ4_AXuT.js +1 -0
  21. package/dist-web/assets/{cose-bilkent-S5V4N54A-COoPAHpC.js → cose-bilkent-S5V4N54A-HNWFCNh9.js} +1 -1
  22. package/dist-web/assets/{dagre-BM42HDAG-BBOPrdG4.js → dagre-BM42HDAG-Dv6WU7Ym.js} +1 -1
  23. package/dist-web/assets/{diagram-2AECGRRQ-LRx2sTw8.js → diagram-2AECGRRQ-DlQ3gFah.js} +1 -1
  24. package/dist-web/assets/{diagram-5GNKFQAL-DsCaLaVB.js → diagram-5GNKFQAL-DdXhz5jN.js} +1 -1
  25. package/dist-web/assets/{diagram-KO2AKTUF-C5eIL5L7.js → diagram-KO2AKTUF-CbAHWTiw.js} +1 -1
  26. package/dist-web/assets/{diagram-LMA3HP47-DFMNWSuI.js → diagram-LMA3HP47-DhASU77a.js} +1 -1
  27. package/dist-web/assets/{diagram-OG6HWLK6-YtRDbT5E.js → diagram-OG6HWLK6-vyegCtBh.js} +1 -1
  28. package/dist-web/assets/{erDiagram-TEJ5UH35-DcGLpZq8.js → erDiagram-TEJ5UH35-u41T2VU1.js} +1 -1
  29. package/dist-web/assets/{flowDiagram-I6XJVG4X-iTJJ8EFf.js → flowDiagram-I6XJVG4X-BlZR3M4a.js} +1 -1
  30. package/dist-web/assets/{ganttDiagram-6RSMTGT7-DQgm6pxo.js → ganttDiagram-6RSMTGT7-CBIULxGb.js} +1 -1
  31. package/dist-web/assets/{gitGraphDiagram-PVQCEYII-DhCBgkG8.js → gitGraphDiagram-PVQCEYII-C6SGJJUo.js} +1 -1
  32. package/dist-web/assets/{index-DpLAujyX.js → index-BNJo44oI.js} +1 -1
  33. package/dist-web/assets/index-CK7yaL8y.js +279 -0
  34. package/dist-web/assets/{index-Cioxfv4p.css → index-D0u_059j.css} +1 -1
  35. package/dist-web/assets/{index-CFiJLIKp.js → index-D3WSVtYV.js} +2 -2
  36. package/dist-web/assets/{index10-Cq9SfqzI.js → index10-CizaPNSY.js} +1 -1
  37. package/dist-web/assets/{index11-BsI2TwS2.js → index11-C3vBSelg.js} +1 -1
  38. package/dist-web/assets/{index5-D0QCZ2WX.js → index5-DCmdgd-c.js} +1 -1
  39. package/dist-web/assets/{index6-BCwMTbX-.js → index6-DeBB3wcO.js} +1 -1
  40. package/dist-web/assets/{index7-ngQ9Fglu.js → index7-D0RS__NS.js} +1 -1
  41. package/dist-web/assets/{index8-B8E09VXR.js → index8-ByeMRBS0.js} +2 -2
  42. package/dist-web/assets/{infoDiagram-5YYISTIA-VG0FT9QF.js → infoDiagram-5YYISTIA-BEQeL8qo.js} +1 -1
  43. package/dist-web/assets/{ishikawaDiagram-YF4QCWOH-57-3fzN_.js → ishikawaDiagram-YF4QCWOH-BGEkrGOU.js} +1 -1
  44. package/dist-web/assets/{journeyDiagram-JHISSGLW-_qj0ZBQM.js → journeyDiagram-JHISSGLW-DAEyZppi.js} +1 -1
  45. package/dist-web/assets/{kanban-definition-UN3LZRKU-cpqKXF62.js → kanban-definition-UN3LZRKU-6nYYByea.js} +1 -1
  46. package/dist-web/assets/{linear-lEP30Zqf.js → linear-RPDuZEc_.js} +1 -1
  47. package/dist-web/assets/{mermaid.core-COCaMagj.js → mermaid.core-CmwZMEVS.js} +4 -4
  48. package/dist-web/assets/{mindmap-definition-RKZ34NQL-BTy9wxvg.js → mindmap-definition-RKZ34NQL-MLtqKWd1.js} +1 -1
  49. package/dist-web/assets/{pieDiagram-4H26LBE5-B9qPVNTt.js → pieDiagram-4H26LBE5-Bfifo7At.js} +1 -1
  50. package/dist-web/assets/{quadrantDiagram-W4KKPZXB-CIkg17kt.js → quadrantDiagram-W4KKPZXB-DZRwxAP7.js} +1 -1
  51. package/dist-web/assets/{requirementDiagram-4Y6WPE33-Cp6p0EDe.js → requirementDiagram-4Y6WPE33-lazNkbiM.js} +1 -1
  52. package/dist-web/assets/{sankeyDiagram-5OEKKPKP-D4mtZQUj.js → sankeyDiagram-5OEKKPKP-D4yxPAzq.js} +1 -1
  53. package/dist-web/assets/{sequenceDiagram-3UESZ5HK-CYHpIUE5.js → sequenceDiagram-3UESZ5HK-D7Cjzr6g.js} +1 -1
  54. package/dist-web/assets/{stateDiagram-AJRCARHV-B1Vf-wla.js → stateDiagram-AJRCARHV-0z8M0BXQ.js} +1 -1
  55. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-lF1PY-XM.js +1 -0
  56. package/dist-web/assets/{timeline-definition-PNZ67QCA-Dau6vvwN.js → timeline-definition-PNZ67QCA-Cfxia7fX.js} +1 -1
  57. package/dist-web/assets/{vennDiagram-CIIHVFJN-DTu2pySe.js → vennDiagram-CIIHVFJN-CBtQvJlD.js} +1 -1
  58. package/dist-web/assets/{vue.runtime.esm-bundler-Bd0MpuGP.js → vue.runtime.esm-bundler-BJW6XsQa.js} +1 -1
  59. package/dist-web/assets/{wardley-L42UT6IY-CRpR3kk0.js → wardley-L42UT6IY-lhlQsxcl.js} +1 -1
  60. package/dist-web/assets/{wardleyDiagram-YWT4CUSO-XbULEr5H.js → wardleyDiagram-YWT4CUSO-CNRYkXLH.js} +1 -1
  61. package/dist-web/assets/{xychartDiagram-2RQKCTM6-C34wLyKM.js → xychartDiagram-2RQKCTM6-mUzDW-MM.js} +1 -1
  62. package/dist-web/index.html +2 -2
  63. package/package.json +5 -5
  64. package/dist-web/assets/channel-DzCUXF8u.js +0 -1
  65. package/dist-web/assets/classDiagram-4FO5ZUOK-Dk9AsUOO.js +0 -1
  66. package/dist-web/assets/classDiagram-v2-Q7XG4LA2-Dk9AsUOO.js +0 -1
  67. package/dist-web/assets/index-CY9IR2gG.js +0 -279
  68. package/dist-web/assets/stateDiagram-v2-BHNVJYJU-BdYtlYmX.js +0 -1
package/dist/main.mjs CHANGED
@@ -5,9 +5,9 @@ const __filename = __cjsShimFileURLToPath(import.meta.url);
5
5
  const __dirname = __cjsShimDirname(__filename);
6
6
  import { createRequire } from "node:module";
7
7
  import crypto$1, { createHash, randomBytes, randomInt, randomUUID, timingSafeEqual } from "node:crypto";
8
- import * as fs$15 from "node:fs";
9
- import Vt, { appendFileSync, chmodSync, closeSync, constants, createReadStream, createWriteStream, existsSync, fsyncSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
10
- import * as path$14 from "node:path";
8
+ import * as fs$16 from "node:fs";
9
+ import Vt, { appendFileSync, chmodSync, closeSync, constants, copyFileSync, createReadStream, createWriteStream, existsSync, fsyncSync, mkdirSync, openSync, promises, readFileSync, readSync, readdirSync, realpathSync, renameSync, rmSync, statSync, unlinkSync, writeFileSync, writeSync } from "node:fs";
10
+ import * as path$15 from "node:path";
11
11
  import path, { basename, dirname, extname, isAbsolute, join, normalize, posix, relative, resolve, sep, win32 } from "node:path";
12
12
  import { spawn } from "child_process";
13
13
  import I, { createWriteStream as createWriteStream$1, existsSync as existsSync$1, promises as promises$1, readdirSync as readdirSync$1, stat, statSync as statSync$1, unwatchFile, watch, watchFile } from "fs";
@@ -29,15 +29,15 @@ import { fileURLToPath, format, pathToFileURL } from "node:url";
29
29
  import net, { createServer as createServer$2, isIP } from "node:net";
30
30
  import Kr, { EventEmitter } from "events";
31
31
  import * as path$1$1 from "path";
32
- import $s, { basename as basename$1, dirname as dirname$1, join as join$1, parse } from "path";
33
- import * as fs$16 from "fs/promises";
32
+ import path$1, { basename as basename$1, dirname as dirname$1, join as join$1, parse } from "path";
33
+ import * as fs$17 from "fs/promises";
34
34
  import { lstat, open, readdir, realpath, stat as stat$1, writeFile } from "fs/promises";
35
35
  import { finished, pipeline as pipeline$1 } from "node:stream/promises";
36
36
  import * as ks from "zlib";
37
37
  import qr from "zlib";
38
38
  import * as nodeOs from "node:os";
39
39
  import os, { arch, homedir as homedir$1, hostname, networkInterfaces, platform, release, tmpdir, type as type$1, userInfo } from "node:os";
40
- import jn, { access, appendFile, chmod, copyFile, cp, lstat as lstat$1, mkdir, mkdtemp, open as open$1, readFile, readdir as readdir$1, realpath as realpath$1, rename, rm, stat as stat$2, unlink, utimes, writeFile as writeFile$1 } from "node:fs/promises";
40
+ import fs, { access, appendFile, chmod, copyFile, cp, lstat as lstat$1, mkdir, mkdtemp, open as open$1, readFile, readdir as readdir$1, realpath as realpath$1, rename, rm, stat as stat$2, unlink, utimes, writeFile as writeFile$1 } from "node:fs/promises";
41
41
  import { execFile, execFileSync, execSync, spawn as spawn$1, spawnSync } from "node:child_process";
42
42
  import * as posixPath from "node:path/posix";
43
43
  import * as win32Path from "node:path/win32";
@@ -3451,7 +3451,7 @@ var init_headers$2 = __esmMin((() => {
3451
3451
  function encodeURIPath$2(str) {
3452
3452
  return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
3453
3453
  }
3454
- var EMPTY$3, createPathTagFunction$2, path$20;
3454
+ var EMPTY$3, createPathTagFunction$2, path$21;
3455
3455
  var init_path$2 = __esmMin((() => {
3456
3456
  init_error$4();
3457
3457
  EMPTY$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
@@ -3494,7 +3494,7 @@ var init_path$2 = __esmMin((() => {
3494
3494
  }
3495
3495
  return path;
3496
3496
  };
3497
- path$20 = /* @__PURE__ */ createPathTagFunction$2(encodeURIPath$2);
3497
+ path$21 = /* @__PURE__ */ createPathTagFunction$2(encodeURIPath$2);
3498
3498
  }));
3499
3499
  //#endregion
3500
3500
  //#region ../../node_modules/.pnpm/@anthropic-ai+sdk@0.95.2_zod@4.3.6/node_modules/@anthropic-ai/sdk/resources/beta/environments.mjs
@@ -3537,7 +3537,7 @@ var init_environments = __esmMin((() => {
3537
3537
  */
3538
3538
  retrieve(environmentID, params = {}, options) {
3539
3539
  const { betas } = params ?? {};
3540
- return this._client.get(path$20`/v1/environments/${environmentID}?beta=true`, {
3540
+ return this._client.get(path$21`/v1/environments/${environmentID}?beta=true`, {
3541
3541
  ...options,
3542
3542
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
3543
3543
  });
@@ -3555,7 +3555,7 @@ var init_environments = __esmMin((() => {
3555
3555
  */
3556
3556
  update(environmentID, params, options) {
3557
3557
  const { betas, ...body } = params;
3558
- return this._client.post(path$20`/v1/environments/${environmentID}?beta=true`, {
3558
+ return this._client.post(path$21`/v1/environments/${environmentID}?beta=true`, {
3559
3559
  body,
3560
3560
  ...options,
3561
3561
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -3593,7 +3593,7 @@ var init_environments = __esmMin((() => {
3593
3593
  */
3594
3594
  delete(environmentID, params = {}, options) {
3595
3595
  const { betas } = params ?? {};
3596
- return this._client.delete(path$20`/v1/environments/${environmentID}?beta=true`, {
3596
+ return this._client.delete(path$21`/v1/environments/${environmentID}?beta=true`, {
3597
3597
  ...options,
3598
3598
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
3599
3599
  });
@@ -3612,7 +3612,7 @@ var init_environments = __esmMin((() => {
3612
3612
  */
3613
3613
  archive(environmentID, params = {}, options) {
3614
3614
  const { betas } = params ?? {};
3615
- return this._client.post(path$20`/v1/environments/${environmentID}/archive?beta=true`, {
3615
+ return this._client.post(path$21`/v1/environments/${environmentID}/archive?beta=true`, {
3616
3616
  ...options,
3617
3617
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
3618
3618
  });
@@ -3704,7 +3704,7 @@ var init_files$3 = __esmMin((() => {
3704
3704
  */
3705
3705
  delete(fileID, params = {}, options) {
3706
3706
  const { betas } = params ?? {};
3707
- return this._client.delete(path$20`/v1/files/${fileID}?beta=true`, {
3707
+ return this._client.delete(path$21`/v1/files/${fileID}?beta=true`, {
3708
3708
  ...options,
3709
3709
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, options?.headers])
3710
3710
  });
@@ -3724,7 +3724,7 @@ var init_files$3 = __esmMin((() => {
3724
3724
  */
3725
3725
  download(fileID, params = {}, options) {
3726
3726
  const { betas } = params ?? {};
3727
- return this._client.get(path$20`/v1/files/${fileID}/content?beta=true`, {
3727
+ return this._client.get(path$21`/v1/files/${fileID}/content?beta=true`, {
3728
3728
  ...options,
3729
3729
  headers: buildHeaders$2([{
3730
3730
  "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString(),
@@ -3744,7 +3744,7 @@ var init_files$3 = __esmMin((() => {
3744
3744
  */
3745
3745
  retrieveMetadata(fileID, params = {}, options) {
3746
3746
  const { betas } = params ?? {};
3747
- return this._client.get(path$20`/v1/files/${fileID}?beta=true`, {
3747
+ return this._client.get(path$21`/v1/files/${fileID}?beta=true`, {
3748
3748
  ...options,
3749
3749
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "files-api-2025-04-14"].toString() }, options?.headers])
3750
3750
  });
@@ -3797,7 +3797,7 @@ var init_models$2 = __esmMin((() => {
3797
3797
  */
3798
3798
  retrieve(modelID, params = {}, options) {
3799
3799
  const { betas } = params ?? {};
3800
- return this._client.get(path$20`/v1/models/${modelID}?beta=true`, {
3800
+ return this._client.get(path$21`/v1/models/${modelID}?beta=true`, {
3801
3801
  ...options,
3802
3802
  headers: buildHeaders$2([{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, options?.headers])
3803
3803
  });
@@ -3865,7 +3865,7 @@ var init_user_profiles = __esmMin((() => {
3865
3865
  */
3866
3866
  retrieve(userProfileID, params = {}, options) {
3867
3867
  const { betas } = params ?? {};
3868
- return this._client.get(path$20`/v1/user_profiles/${userProfileID}?beta=true`, {
3868
+ return this._client.get(path$21`/v1/user_profiles/${userProfileID}?beta=true`, {
3869
3869
  ...options,
3870
3870
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "user-profiles-2026-03-24"].toString() }, options?.headers])
3871
3871
  });
@@ -3883,7 +3883,7 @@ var init_user_profiles = __esmMin((() => {
3883
3883
  */
3884
3884
  update(userProfileID, params, options) {
3885
3885
  const { betas, ...body } = params;
3886
- return this._client.post(path$20`/v1/user_profiles/${userProfileID}?beta=true`, {
3886
+ return this._client.post(path$21`/v1/user_profiles/${userProfileID}?beta=true`, {
3887
3887
  body,
3888
3888
  ...options,
3889
3889
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "user-profiles-2026-03-24"].toString() }, options?.headers])
@@ -3921,7 +3921,7 @@ var init_user_profiles = __esmMin((() => {
3921
3921
  */
3922
3922
  createEnrollmentURL(userProfileID, params = {}, options) {
3923
3923
  const { betas } = params ?? {};
3924
- return this._client.post(path$20`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {
3924
+ return this._client.post(path$21`/v1/user_profiles/${userProfileID}/enrollment_url?beta=true`, {
3925
3925
  ...options,
3926
3926
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "user-profiles-2026-03-24"].toString() }, options?.headers])
3927
3927
  });
@@ -4627,7 +4627,7 @@ var init_versions$3 = __esmMin((() => {
4627
4627
  */
4628
4628
  list(agentID, params = {}, options) {
4629
4629
  const { betas, ...query } = params ?? {};
4630
- return this._client.getAPIList(path$20`/v1/agents/${agentID}/versions?beta=true`, PageCursor, {
4630
+ return this._client.getAPIList(path$21`/v1/agents/${agentID}/versions?beta=true`, PageCursor, {
4631
4631
  query,
4632
4632
  ...options,
4633
4633
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4682,7 +4682,7 @@ var init_agents = __esmMin((() => {
4682
4682
  */
4683
4683
  retrieve(agentID, params = {}, options) {
4684
4684
  const { betas, ...query } = params ?? {};
4685
- return this._client.get(path$20`/v1/agents/${agentID}?beta=true`, {
4685
+ return this._client.get(path$21`/v1/agents/${agentID}?beta=true`, {
4686
4686
  query,
4687
4687
  ...options,
4688
4688
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4702,7 +4702,7 @@ var init_agents = __esmMin((() => {
4702
4702
  */
4703
4703
  update(agentID, params, options) {
4704
4704
  const { betas, ...body } = params;
4705
- return this._client.post(path$20`/v1/agents/${agentID}?beta=true`, {
4705
+ return this._client.post(path$21`/v1/agents/${agentID}?beta=true`, {
4706
4706
  body,
4707
4707
  ...options,
4708
4708
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4740,7 +4740,7 @@ var init_agents = __esmMin((() => {
4740
4740
  */
4741
4741
  archive(agentID, params = {}, options) {
4742
4742
  const { betas } = params ?? {};
4743
- return this._client.post(path$20`/v1/agents/${agentID}/archive?beta=true`, {
4743
+ return this._client.post(path$21`/v1/agents/${agentID}/archive?beta=true`, {
4744
4744
  ...options,
4745
4745
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
4746
4746
  });
@@ -4771,7 +4771,7 @@ var init_memories = __esmMin((() => {
4771
4771
  */
4772
4772
  create(memoryStoreID, params, options) {
4773
4773
  const { view, betas, ...body } = params;
4774
- return this._client.post(path$20`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, {
4774
+ return this._client.post(path$21`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, {
4775
4775
  query: { view },
4776
4776
  body,
4777
4777
  ...options,
@@ -4792,7 +4792,7 @@ var init_memories = __esmMin((() => {
4792
4792
  */
4793
4793
  retrieve(memoryID, params, options) {
4794
4794
  const { memory_store_id, betas, ...query } = params;
4795
- return this._client.get(path$20`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4795
+ return this._client.get(path$21`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4796
4796
  query,
4797
4797
  ...options,
4798
4798
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4812,7 +4812,7 @@ var init_memories = __esmMin((() => {
4812
4812
  */
4813
4813
  update(memoryID, params, options) {
4814
4814
  const { memory_store_id, view, betas, ...body } = params;
4815
- return this._client.post(path$20`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4815
+ return this._client.post(path$21`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4816
4816
  query: { view },
4817
4817
  body,
4818
4818
  ...options,
@@ -4834,7 +4834,7 @@ var init_memories = __esmMin((() => {
4834
4834
  */
4835
4835
  list(memoryStoreID, params = {}, options) {
4836
4836
  const { betas, ...query } = params ?? {};
4837
- return this._client.getAPIList(path$20`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, {
4837
+ return this._client.getAPIList(path$21`/v1/memory_stores/${memoryStoreID}/memories?beta=true`, PageCursor, {
4838
4838
  query,
4839
4839
  ...options,
4840
4840
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4854,7 +4854,7 @@ var init_memories = __esmMin((() => {
4854
4854
  */
4855
4855
  delete(memoryID, params, options) {
4856
4856
  const { memory_store_id, expected_content_sha256, betas } = params;
4857
- return this._client.delete(path$20`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4857
+ return this._client.delete(path$21`/v1/memory_stores/${memory_store_id}/memories/${memoryID}?beta=true`, {
4858
4858
  query: { expected_content_sha256 },
4859
4859
  ...options,
4860
4860
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4885,7 +4885,7 @@ var init_memory_versions = __esmMin((() => {
4885
4885
  */
4886
4886
  retrieve(memoryVersionID, params, options) {
4887
4887
  const { memory_store_id, betas, ...query } = params;
4888
- return this._client.get(path$20`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, {
4888
+ return this._client.get(path$21`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}?beta=true`, {
4889
4889
  query,
4890
4890
  ...options,
4891
4891
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4906,7 +4906,7 @@ var init_memory_versions = __esmMin((() => {
4906
4906
  */
4907
4907
  list(memoryStoreID, params = {}, options) {
4908
4908
  const { betas, ...query } = params ?? {};
4909
- return this._client.getAPIList(path$20`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, {
4909
+ return this._client.getAPIList(path$21`/v1/memory_stores/${memoryStoreID}/memory_versions?beta=true`, PageCursor, {
4910
4910
  query,
4911
4911
  ...options,
4912
4912
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -4926,7 +4926,7 @@ var init_memory_versions = __esmMin((() => {
4926
4926
  */
4927
4927
  redact(memoryVersionID, params, options) {
4928
4928
  const { memory_store_id, betas } = params;
4929
- return this._client.post(path$20`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, {
4929
+ return this._client.post(path$21`/v1/memory_stores/${memory_store_id}/memory_versions/${memoryVersionID}/redact?beta=true`, {
4930
4930
  ...options,
4931
4931
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
4932
4932
  });
@@ -4979,7 +4979,7 @@ var init_memory_stores = __esmMin((() => {
4979
4979
  */
4980
4980
  retrieve(memoryStoreID, params = {}, options) {
4981
4981
  const { betas } = params ?? {};
4982
- return this._client.get(path$20`/v1/memory_stores/${memoryStoreID}?beta=true`, {
4982
+ return this._client.get(path$21`/v1/memory_stores/${memoryStoreID}?beta=true`, {
4983
4983
  ...options,
4984
4984
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
4985
4985
  });
@@ -4995,7 +4995,7 @@ var init_memory_stores = __esmMin((() => {
4995
4995
  */
4996
4996
  update(memoryStoreID, params, options) {
4997
4997
  const { betas, ...body } = params;
4998
- return this._client.post(path$20`/v1/memory_stores/${memoryStoreID}?beta=true`, {
4998
+ return this._client.post(path$21`/v1/memory_stores/${memoryStoreID}?beta=true`, {
4999
4999
  body,
5000
5000
  ...options,
5001
5001
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -5031,7 +5031,7 @@ var init_memory_stores = __esmMin((() => {
5031
5031
  */
5032
5032
  delete(memoryStoreID, params = {}, options) {
5033
5033
  const { betas } = params ?? {};
5034
- return this._client.delete(path$20`/v1/memory_stores/${memoryStoreID}?beta=true`, {
5034
+ return this._client.delete(path$21`/v1/memory_stores/${memoryStoreID}?beta=true`, {
5035
5035
  ...options,
5036
5036
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
5037
5037
  });
@@ -5047,7 +5047,7 @@ var init_memory_stores = __esmMin((() => {
5047
5047
  */
5048
5048
  archive(memoryStoreID, params = {}, options) {
5049
5049
  const { betas } = params ?? {};
5050
- return this._client.post(path$20`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, {
5050
+ return this._client.post(path$21`/v1/memory_stores/${memoryStoreID}/archive?beta=true`, {
5051
5051
  ...options,
5052
5052
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
5053
5053
  });
@@ -5157,7 +5157,7 @@ var init_batches$2 = __esmMin((() => {
5157
5157
  */
5158
5158
  retrieve(messageBatchID, params = {}, options) {
5159
5159
  const { betas } = params ?? {};
5160
- return this._client.get(path$20`/v1/messages/batches/${messageBatchID}?beta=true`, {
5160
+ return this._client.get(path$21`/v1/messages/batches/${messageBatchID}?beta=true`, {
5161
5161
  ...options,
5162
5162
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, options?.headers])
5163
5163
  });
@@ -5204,7 +5204,7 @@ var init_batches$2 = __esmMin((() => {
5204
5204
  */
5205
5205
  delete(messageBatchID, params = {}, options) {
5206
5206
  const { betas } = params ?? {};
5207
- return this._client.delete(path$20`/v1/messages/batches/${messageBatchID}?beta=true`, {
5207
+ return this._client.delete(path$21`/v1/messages/batches/${messageBatchID}?beta=true`, {
5208
5208
  ...options,
5209
5209
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, options?.headers])
5210
5210
  });
@@ -5233,7 +5233,7 @@ var init_batches$2 = __esmMin((() => {
5233
5233
  */
5234
5234
  cancel(messageBatchID, params = {}, options) {
5235
5235
  const { betas } = params ?? {};
5236
- return this._client.post(path$20`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
5236
+ return this._client.post(path$21`/v1/messages/batches/${messageBatchID}/cancel?beta=true`, {
5237
5237
  ...options,
5238
5238
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "message-batches-2024-09-24"].toString() }, options?.headers])
5239
5239
  });
@@ -6573,7 +6573,7 @@ var init_events$4 = __esmMin((() => {
6573
6573
  */
6574
6574
  list(sessionID, params = {}, options) {
6575
6575
  const { betas, ...query } = params ?? {};
6576
- return this._client.getAPIList(path$20`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, {
6576
+ return this._client.getAPIList(path$21`/v1/sessions/${sessionID}/events?beta=true`, PageCursor, {
6577
6577
  query,
6578
6578
  ...options,
6579
6579
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6605,7 +6605,7 @@ var init_events$4 = __esmMin((() => {
6605
6605
  */
6606
6606
  send(sessionID, params, options) {
6607
6607
  const { betas, ...body } = params;
6608
- return this._client.post(path$20`/v1/sessions/${sessionID}/events?beta=true`, {
6608
+ return this._client.post(path$21`/v1/sessions/${sessionID}/events?beta=true`, {
6609
6609
  body,
6610
6610
  ...options,
6611
6611
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6624,7 +6624,7 @@ var init_events$4 = __esmMin((() => {
6624
6624
  */
6625
6625
  stream(sessionID, params = {}, options) {
6626
6626
  const { betas } = params ?? {};
6627
- return this._client.get(path$20`/v1/sessions/${sessionID}/events/stream?beta=true`, {
6627
+ return this._client.get(path$21`/v1/sessions/${sessionID}/events/stream?beta=true`, {
6628
6628
  ...options,
6629
6629
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers]),
6630
6630
  stream: true
@@ -6655,7 +6655,7 @@ var init_resources$2 = __esmMin((() => {
6655
6655
  */
6656
6656
  retrieve(resourceID, params, options) {
6657
6657
  const { session_id, betas } = params;
6658
- return this._client.get(path$20`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6658
+ return this._client.get(path$21`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6659
6659
  ...options,
6660
6660
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6661
6661
  });
@@ -6677,7 +6677,7 @@ var init_resources$2 = __esmMin((() => {
6677
6677
  */
6678
6678
  update(resourceID, params, options) {
6679
6679
  const { session_id, betas, ...body } = params;
6680
- return this._client.post(path$20`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6680
+ return this._client.post(path$21`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6681
6681
  body,
6682
6682
  ...options,
6683
6683
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6698,7 +6698,7 @@ var init_resources$2 = __esmMin((() => {
6698
6698
  */
6699
6699
  list(sessionID, params = {}, options) {
6700
6700
  const { betas, ...query } = params ?? {};
6701
- return this._client.getAPIList(path$20`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, {
6701
+ return this._client.getAPIList(path$21`/v1/sessions/${sessionID}/resources?beta=true`, PageCursor, {
6702
6702
  query,
6703
6703
  ...options,
6704
6704
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6718,7 +6718,7 @@ var init_resources$2 = __esmMin((() => {
6718
6718
  */
6719
6719
  delete(resourceID, params, options) {
6720
6720
  const { session_id, betas } = params;
6721
- return this._client.delete(path$20`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6721
+ return this._client.delete(path$21`/v1/sessions/${session_id}/resources/${resourceID}?beta=true`, {
6722
6722
  ...options,
6723
6723
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6724
6724
  });
@@ -6740,7 +6740,7 @@ var init_resources$2 = __esmMin((() => {
6740
6740
  */
6741
6741
  add(sessionID, params, options) {
6742
6742
  const { betas, ...body } = params;
6743
- return this._client.post(path$20`/v1/sessions/${sessionID}/resources?beta=true`, {
6743
+ return this._client.post(path$21`/v1/sessions/${sessionID}/resources?beta=true`, {
6744
6744
  body,
6745
6745
  ...options,
6746
6746
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6773,7 +6773,7 @@ var init_events$3 = __esmMin((() => {
6773
6773
  */
6774
6774
  list(threadID, params, options) {
6775
6775
  const { session_id, betas, ...query } = params;
6776
- return this._client.getAPIList(path$20`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, {
6776
+ return this._client.getAPIList(path$21`/v1/sessions/${session_id}/threads/${threadID}/events?beta=true`, PageCursor, {
6777
6777
  query,
6778
6778
  ...options,
6779
6779
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6793,7 +6793,7 @@ var init_events$3 = __esmMin((() => {
6793
6793
  */
6794
6794
  stream(threadID, params, options) {
6795
6795
  const { session_id, betas } = params;
6796
- return this._client.get(path$20`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, {
6796
+ return this._client.get(path$21`/v1/sessions/${session_id}/threads/${threadID}/stream?beta=true`, {
6797
6797
  ...options,
6798
6798
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers]),
6799
6799
  stream: true
@@ -6829,7 +6829,7 @@ var init_threads$2 = __esmMin((() => {
6829
6829
  */
6830
6830
  retrieve(threadID, params, options) {
6831
6831
  const { session_id, betas } = params;
6832
- return this._client.get(path$20`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, {
6832
+ return this._client.get(path$21`/v1/sessions/${session_id}/threads/${threadID}?beta=true`, {
6833
6833
  ...options,
6834
6834
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6835
6835
  });
@@ -6849,7 +6849,7 @@ var init_threads$2 = __esmMin((() => {
6849
6849
  */
6850
6850
  list(sessionID, params = {}, options) {
6851
6851
  const { betas, ...query } = params ?? {};
6852
- return this._client.getAPIList(path$20`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, {
6852
+ return this._client.getAPIList(path$21`/v1/sessions/${sessionID}/threads?beta=true`, PageCursor, {
6853
6853
  query,
6854
6854
  ...options,
6855
6855
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6869,7 +6869,7 @@ var init_threads$2 = __esmMin((() => {
6869
6869
  */
6870
6870
  archive(threadID, params, options) {
6871
6871
  const { session_id, betas } = params;
6872
- return this._client.post(path$20`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, {
6872
+ return this._client.post(path$21`/v1/sessions/${session_id}/threads/${threadID}/archive?beta=true`, {
6873
6873
  ...options,
6874
6874
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6875
6875
  });
@@ -6928,7 +6928,7 @@ var init_sessions$3 = __esmMin((() => {
6928
6928
  */
6929
6929
  retrieve(sessionID, params = {}, options) {
6930
6930
  const { betas } = params ?? {};
6931
- return this._client.get(path$20`/v1/sessions/${sessionID}?beta=true`, {
6931
+ return this._client.get(path$21`/v1/sessions/${sessionID}?beta=true`, {
6932
6932
  ...options,
6933
6933
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6934
6934
  });
@@ -6946,7 +6946,7 @@ var init_sessions$3 = __esmMin((() => {
6946
6946
  */
6947
6947
  update(sessionID, params, options) {
6948
6948
  const { betas, ...body } = params;
6949
- return this._client.post(path$20`/v1/sessions/${sessionID}?beta=true`, {
6949
+ return this._client.post(path$21`/v1/sessions/${sessionID}?beta=true`, {
6950
6950
  body,
6951
6951
  ...options,
6952
6952
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -6984,7 +6984,7 @@ var init_sessions$3 = __esmMin((() => {
6984
6984
  */
6985
6985
  delete(sessionID, params = {}, options) {
6986
6986
  const { betas } = params ?? {};
6987
- return this._client.delete(path$20`/v1/sessions/${sessionID}?beta=true`, {
6987
+ return this._client.delete(path$21`/v1/sessions/${sessionID}?beta=true`, {
6988
6988
  ...options,
6989
6989
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
6990
6990
  });
@@ -7002,7 +7002,7 @@ var init_sessions$3 = __esmMin((() => {
7002
7002
  */
7003
7003
  archive(sessionID, params = {}, options) {
7004
7004
  const { betas } = params ?? {};
7005
- return this._client.post(path$20`/v1/sessions/${sessionID}/archive?beta=true`, {
7005
+ return this._client.post(path$21`/v1/sessions/${sessionID}/archive?beta=true`, {
7006
7006
  ...options,
7007
7007
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7008
7008
  });
@@ -7034,7 +7034,7 @@ var init_versions$2 = __esmMin((() => {
7034
7034
  */
7035
7035
  create(skillID, params = {}, options) {
7036
7036
  const { betas, ...body } = params ?? {};
7037
- return this._client.post(path$20`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions$1({
7037
+ return this._client.post(path$21`/v1/skills/${skillID}/versions?beta=true`, multipartFormRequestOptions$1({
7038
7038
  body,
7039
7039
  ...options,
7040
7040
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
@@ -7053,7 +7053,7 @@ var init_versions$2 = __esmMin((() => {
7053
7053
  */
7054
7054
  retrieve(version, params, options) {
7055
7055
  const { skill_id, betas } = params;
7056
- return this._client.get(path$20`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
7056
+ return this._client.get(path$21`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
7057
7057
  ...options,
7058
7058
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
7059
7059
  });
@@ -7073,7 +7073,7 @@ var init_versions$2 = __esmMin((() => {
7073
7073
  */
7074
7074
  list(skillID, params = {}, options) {
7075
7075
  const { betas, ...query } = params ?? {};
7076
- return this._client.getAPIList(path$20`/v1/skills/${skillID}/versions?beta=true`, PageCursor, {
7076
+ return this._client.getAPIList(path$21`/v1/skills/${skillID}/versions?beta=true`, PageCursor, {
7077
7077
  query,
7078
7078
  ...options,
7079
7079
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
@@ -7092,7 +7092,7 @@ var init_versions$2 = __esmMin((() => {
7092
7092
  */
7093
7093
  delete(version, params, options) {
7094
7094
  const { skill_id, betas } = params;
7095
- return this._client.delete(path$20`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
7095
+ return this._client.delete(path$21`/v1/skills/${skill_id}/versions/${version}?beta=true`, {
7096
7096
  ...options,
7097
7097
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
7098
7098
  });
@@ -7140,7 +7140,7 @@ var init_skills$1 = __esmMin((() => {
7140
7140
  */
7141
7141
  retrieve(skillID, params = {}, options) {
7142
7142
  const { betas } = params ?? {};
7143
- return this._client.get(path$20`/v1/skills/${skillID}?beta=true`, {
7143
+ return this._client.get(path$21`/v1/skills/${skillID}?beta=true`, {
7144
7144
  ...options,
7145
7145
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
7146
7146
  });
@@ -7174,7 +7174,7 @@ var init_skills$1 = __esmMin((() => {
7174
7174
  */
7175
7175
  delete(skillID, params = {}, options) {
7176
7176
  const { betas } = params ?? {};
7177
- return this._client.delete(path$20`/v1/skills/${skillID}?beta=true`, {
7177
+ return this._client.delete(path$21`/v1/skills/${skillID}?beta=true`, {
7178
7178
  ...options,
7179
7179
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "skills-2025-10-02"].toString() }, options?.headers])
7180
7180
  });
@@ -7212,7 +7212,7 @@ var init_credentials = __esmMin((() => {
7212
7212
  */
7213
7213
  create(vaultID, params, options) {
7214
7214
  const { betas, ...body } = params;
7215
- return this._client.post(path$20`/v1/vaults/${vaultID}/credentials?beta=true`, {
7215
+ return this._client.post(path$21`/v1/vaults/${vaultID}/credentials?beta=true`, {
7216
7216
  body,
7217
7217
  ...options,
7218
7218
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -7232,7 +7232,7 @@ var init_credentials = __esmMin((() => {
7232
7232
  */
7233
7233
  retrieve(credentialID, params, options) {
7234
7234
  const { vault_id, betas } = params;
7235
- return this._client.get(path$20`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7235
+ return this._client.get(path$21`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7236
7236
  ...options,
7237
7237
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7238
7238
  });
@@ -7251,7 +7251,7 @@ var init_credentials = __esmMin((() => {
7251
7251
  */
7252
7252
  update(credentialID, params, options) {
7253
7253
  const { vault_id, betas, ...body } = params;
7254
- return this._client.post(path$20`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7254
+ return this._client.post(path$21`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7255
7255
  body,
7256
7256
  ...options,
7257
7257
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -7272,7 +7272,7 @@ var init_credentials = __esmMin((() => {
7272
7272
  */
7273
7273
  list(vaultID, params = {}, options) {
7274
7274
  const { betas, ...query } = params ?? {};
7275
- return this._client.getAPIList(path$20`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, {
7275
+ return this._client.getAPIList(path$21`/v1/vaults/${vaultID}/credentials?beta=true`, PageCursor, {
7276
7276
  query,
7277
7277
  ...options,
7278
7278
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -7292,7 +7292,7 @@ var init_credentials = __esmMin((() => {
7292
7292
  */
7293
7293
  delete(credentialID, params, options) {
7294
7294
  const { vault_id, betas } = params;
7295
- return this._client.delete(path$20`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7295
+ return this._client.delete(path$21`/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
7296
7296
  ...options,
7297
7297
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7298
7298
  });
@@ -7311,7 +7311,7 @@ var init_credentials = __esmMin((() => {
7311
7311
  */
7312
7312
  archive(credentialID, params, options) {
7313
7313
  const { vault_id, betas } = params;
7314
- return this._client.post(path$20`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, {
7314
+ return this._client.post(path$21`/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, {
7315
7315
  ...options,
7316
7316
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7317
7317
  });
@@ -7330,7 +7330,7 @@ var init_credentials = __esmMin((() => {
7330
7330
  */
7331
7331
  mcpOAuthValidate(credentialID, params, options) {
7332
7332
  const { vault_id, betas } = params;
7333
- return this._client.post(path$20`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, {
7333
+ return this._client.post(path$21`/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, {
7334
7334
  ...options,
7335
7335
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7336
7336
  });
@@ -7383,7 +7383,7 @@ var init_vaults = __esmMin((() => {
7383
7383
  */
7384
7384
  retrieve(vaultID, params = {}, options) {
7385
7385
  const { betas } = params ?? {};
7386
- return this._client.get(path$20`/v1/vaults/${vaultID}?beta=true`, {
7386
+ return this._client.get(path$21`/v1/vaults/${vaultID}?beta=true`, {
7387
7387
  ...options,
7388
7388
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7389
7389
  });
@@ -7401,7 +7401,7 @@ var init_vaults = __esmMin((() => {
7401
7401
  */
7402
7402
  update(vaultID, params, options) {
7403
7403
  const { betas, ...body } = params;
7404
- return this._client.post(path$20`/v1/vaults/${vaultID}?beta=true`, {
7404
+ return this._client.post(path$21`/v1/vaults/${vaultID}?beta=true`, {
7405
7405
  body,
7406
7406
  ...options,
7407
7407
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
@@ -7439,7 +7439,7 @@ var init_vaults = __esmMin((() => {
7439
7439
  */
7440
7440
  delete(vaultID, params = {}, options) {
7441
7441
  const { betas } = params ?? {};
7442
- return this._client.delete(path$20`/v1/vaults/${vaultID}?beta=true`, {
7442
+ return this._client.delete(path$21`/v1/vaults/${vaultID}?beta=true`, {
7443
7443
  ...options,
7444
7444
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7445
7445
  });
@@ -7457,7 +7457,7 @@ var init_vaults = __esmMin((() => {
7457
7457
  */
7458
7458
  archive(vaultID, params = {}, options) {
7459
7459
  const { betas } = params ?? {};
7460
- return this._client.post(path$20`/v1/vaults/${vaultID}/archive?beta=true`, {
7460
+ return this._client.post(path$21`/v1/vaults/${vaultID}/archive?beta=true`, {
7461
7461
  ...options,
7462
7462
  headers: buildHeaders$2([{ "anthropic-beta": [...betas ?? [], "managed-agents-2026-04-01"].toString() }, options?.headers])
7463
7463
  });
@@ -8134,7 +8134,7 @@ var init_batches$1 = __esmMin((() => {
8134
8134
  * ```
8135
8135
  */
8136
8136
  retrieve(messageBatchID, options) {
8137
- return this._client.get(path$20`/v1/messages/batches/${messageBatchID}`, options);
8137
+ return this._client.get(path$21`/v1/messages/batches/${messageBatchID}`, options);
8138
8138
  }
8139
8139
  /**
8140
8140
  * List all Message Batches within a Workspace. Most recently created batches are
@@ -8173,7 +8173,7 @@ var init_batches$1 = __esmMin((() => {
8173
8173
  * ```
8174
8174
  */
8175
8175
  delete(messageBatchID, options) {
8176
- return this._client.delete(path$20`/v1/messages/batches/${messageBatchID}`, options);
8176
+ return this._client.delete(path$21`/v1/messages/batches/${messageBatchID}`, options);
8177
8177
  }
8178
8178
  /**
8179
8179
  * Batches may be canceled any time before processing ends. Once cancellation is
@@ -8197,7 +8197,7 @@ var init_batches$1 = __esmMin((() => {
8197
8197
  * ```
8198
8198
  */
8199
8199
  cancel(messageBatchID, options) {
8200
- return this._client.post(path$20`/v1/messages/batches/${messageBatchID}/cancel`, options);
8200
+ return this._client.post(path$21`/v1/messages/batches/${messageBatchID}/cancel`, options);
8201
8201
  }
8202
8202
  /**
8203
8203
  * Streams the results of a Message Batch as a `.jsonl` file.
@@ -8369,7 +8369,7 @@ var init_models$1 = __esmMin((() => {
8369
8369
  */
8370
8370
  retrieve(modelID, params = {}, options) {
8371
8371
  const { betas } = params ?? {};
8372
- return this._client.get(path$20`/v1/models/${modelID}`, {
8372
+ return this._client.get(path$21`/v1/models/${modelID}`, {
8373
8373
  ...options,
8374
8374
  headers: buildHeaders$2([{ ...betas?.toString() != null ? { "anthropic-beta": betas?.toString() } : void 0 }, options?.headers])
8375
8375
  });
@@ -20826,9 +20826,9 @@ var require_util$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
20826
20826
  exports.removeUndefinedValuesInObject = removeUndefinedValuesInObject;
20827
20827
  exports.isValidFile = isValidFile;
20828
20828
  exports.getWellKnownCertificateConfigFileLocation = getWellKnownCertificateConfigFileLocation;
20829
- const fs$22 = __require("fs");
20829
+ const fs$23 = __require("fs");
20830
20830
  const os$7 = __require("os");
20831
- const path$19 = __require("path");
20831
+ const path$20 = __require("path");
20832
20832
  const WELL_KNOWN_CERTIFICATE_CONFIG_FILE = "certificate_config.json";
20833
20833
  const CLOUDSDK_CONFIG_DIRECTORY = "gcloud";
20834
20834
  /**
@@ -20946,7 +20946,7 @@ var require_util$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
20946
20946
  */
20947
20947
  async function isValidFile(filePath) {
20948
20948
  try {
20949
- return (await fs$22.promises.lstat(filePath)).isFile();
20949
+ return (await fs$23.promises.lstat(filePath)).isFile();
20950
20950
  } catch (e) {
20951
20951
  return false;
20952
20952
  }
@@ -20957,8 +20957,8 @@ var require_util$10 = /* @__PURE__ */ __commonJSMin(((exports) => {
20957
20957
  * @internal
20958
20958
  */
20959
20959
  function getWellKnownCertificateConfigFileLocation() {
20960
- const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ? path$19.join(process.env.APPDATA || "", CLOUDSDK_CONFIG_DIRECTORY) : path$19.join(process.env.HOME || "", ".config", CLOUDSDK_CONFIG_DIRECTORY));
20961
- return path$19.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
20960
+ const configDir = process.env.CLOUDSDK_CONFIG || (_isWindows() ? path$20.join(process.env.APPDATA || "", CLOUDSDK_CONFIG_DIRECTORY) : path$20.join(process.env.HOME || "", ".config", CLOUDSDK_CONFIG_DIRECTORY));
20961
+ return path$20.join(configDir, WELL_KNOWN_CERTIFICATE_CONFIG_FILE);
20962
20962
  }
20963
20963
  /**
20964
20964
  * Checks if the current operating system is Windows.
@@ -22659,11 +22659,11 @@ var require_errorWithCode = /* @__PURE__ */ __commonJSMin(((exports) => {
22659
22659
  var require_getCredentials = /* @__PURE__ */ __commonJSMin(((exports) => {
22660
22660
  Object.defineProperty(exports, "__esModule", { value: true });
22661
22661
  exports.getCredentials = getCredentials;
22662
- const path$18 = __require("path");
22663
- const fs$21 = __require("fs");
22662
+ const path$19 = __require("path");
22663
+ const fs$22 = __require("fs");
22664
22664
  const util_1$1 = __require("util");
22665
22665
  const errorWithCode_1 = require_errorWithCode();
22666
- const readFile = fs$21.readFile ? (0, util_1$1.promisify)(fs$21.readFile) : async () => {
22666
+ const readFile = fs$22.readFile ? (0, util_1$1.promisify)(fs$22.readFile) : async () => {
22667
22667
  throw new errorWithCode_1.ErrorWithCode("use key rather than keyFile.", "MISSING_CREDENTIALS");
22668
22668
  };
22669
22669
  var ExtensionFiles;
@@ -22742,7 +22742,7 @@ var require_getCredentials = /* @__PURE__ */ __commonJSMin(((exports) => {
22742
22742
  * @returns An instance of a class that implements ICredentialsProvider.
22743
22743
  */
22744
22744
  static create(keyFilePath) {
22745
- switch (path$18.extname(keyFilePath)) {
22745
+ switch (path$19.extname(keyFilePath)) {
22746
22746
  case ExtensionFiles.JSON: return new JsonCredentialsProvider(keyFilePath);
22747
22747
  case ExtensionFiles.DER:
22748
22748
  case ExtensionFiles.CRT:
@@ -24211,10 +24211,10 @@ var require_filesubjecttokensupplier = /* @__PURE__ */ __commonJSMin(((exports)
24211
24211
  Object.defineProperty(exports, "__esModule", { value: true });
24212
24212
  exports.FileSubjectTokenSupplier = void 0;
24213
24213
  const util_1 = __require("util");
24214
- const fs$20 = __require("fs");
24215
- const readFile = (0, util_1.promisify)(fs$20.readFile ?? (() => {}));
24216
- const realpath = (0, util_1.promisify)(fs$20.realpath ?? (() => {}));
24217
- const lstat = (0, util_1.promisify)(fs$20.lstat ?? (() => {}));
24214
+ const fs$21 = __require("fs");
24215
+ const readFile = (0, util_1.promisify)(fs$21.readFile ?? (() => {}));
24216
+ const realpath = (0, util_1.promisify)(fs$21.realpath ?? (() => {}));
24217
+ const lstat = (0, util_1.promisify)(fs$21.lstat ?? (() => {}));
24218
24218
  /**
24219
24219
  * Internal subject token supplier implementation used when a file location
24220
24220
  * is configured in the credential configuration used to build an {@link IdentityPoolClient}
@@ -24316,7 +24316,7 @@ var require_certificatesubjecttokensupplier = /* @__PURE__ */ __commonJSMin(((ex
24316
24316
  Object.defineProperty(exports, "__esModule", { value: true });
24317
24317
  exports.CertificateSubjectTokenSupplier = exports.InvalidConfigurationError = exports.CertificateSourceUnavailableError = exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = void 0;
24318
24318
  const util_1 = require_util$10();
24319
- const fs$19 = __require("fs");
24319
+ const fs$20 = __require("fs");
24320
24320
  const crypto_1 = __require("crypto");
24321
24321
  const https$3 = __require("https");
24322
24322
  exports.CERTIFICATE_CONFIGURATION_ENV_VARIABLE = "GOOGLE_API_CERTIFICATE_CONFIG";
@@ -24411,7 +24411,7 @@ var require_certificatesubjecttokensupplier = /* @__PURE__ */ __commonJSMin(((ex
24411
24411
  const configPath = this.certificateConfigPath;
24412
24412
  let fileContents;
24413
24413
  try {
24414
- fileContents = await fs$19.promises.readFile(configPath, "utf8");
24414
+ fileContents = await fs$20.promises.readFile(configPath, "utf8");
24415
24415
  } catch (err) {
24416
24416
  throw new CertificateSourceUnavailableError(`Failed to read certificate config file at: ${configPath}`);
24417
24417
  }
@@ -24436,13 +24436,13 @@ var require_certificatesubjecttokensupplier = /* @__PURE__ */ __commonJSMin(((ex
24436
24436
  async #getKeyAndCert(certPath, keyPath) {
24437
24437
  let cert, key;
24438
24438
  try {
24439
- cert = await fs$19.promises.readFile(certPath);
24439
+ cert = await fs$20.promises.readFile(certPath);
24440
24440
  new crypto_1.X509Certificate(cert);
24441
24441
  } catch (err) {
24442
24442
  throw new CertificateSourceUnavailableError(`Failed to read certificate file at ${certPath}: ${err instanceof Error ? err.message : String(err)}`);
24443
24443
  }
24444
24444
  try {
24445
- key = await fs$19.promises.readFile(keyPath);
24445
+ key = await fs$20.promises.readFile(keyPath);
24446
24446
  (0, crypto_1.createPrivateKey)(key);
24447
24447
  } catch (err) {
24448
24448
  throw new CertificateSourceUnavailableError(`Failed to read private key file at ${keyPath}: ${err instanceof Error ? err.message : String(err)}`);
@@ -24461,7 +24461,7 @@ var require_certificatesubjecttokensupplier = /* @__PURE__ */ __commonJSMin(((ex
24461
24461
  const leafCert = new crypto_1.X509Certificate(leafCertBuffer);
24462
24462
  if (!this.trustChainPath) return JSON.stringify([leafCert.raw.toString("base64")]);
24463
24463
  try {
24464
- const chainCerts = ((await fs$19.promises.readFile(this.trustChainPath, "utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g) ?? []).map((pem, index) => {
24464
+ const chainCerts = ((await fs$20.promises.readFile(this.trustChainPath, "utf8")).match(/-----BEGIN CERTIFICATE-----[^-]+-----END CERTIFICATE-----/g) ?? []).map((pem, index) => {
24465
24465
  try {
24466
24466
  return new crypto_1.X509Certificate(pem);
24467
24467
  } catch (err) {
@@ -25122,7 +25122,7 @@ var require_pluggable_auth_handler = /* @__PURE__ */ __commonJSMin(((exports) =>
25122
25122
  exports.PluggableAuthHandler = exports.ExecutableError = void 0;
25123
25123
  const executable_response_1 = require_executable_response();
25124
25124
  const childProcess$1 = __require("child_process");
25125
- const fs$18 = __require("fs");
25125
+ const fs$19 = __require("fs");
25126
25126
  /**
25127
25127
  * Error thrown from the executable run by PluggableAuthClient.
25128
25128
  */
@@ -25199,12 +25199,12 @@ var require_pluggable_auth_handler = /* @__PURE__ */ __commonJSMin(((exports) =>
25199
25199
  if (!this.outputFile || this.outputFile.length === 0) return;
25200
25200
  let filePath;
25201
25201
  try {
25202
- filePath = await fs$18.promises.realpath(this.outputFile);
25202
+ filePath = await fs$19.promises.realpath(this.outputFile);
25203
25203
  } catch {
25204
25204
  return;
25205
25205
  }
25206
- if (!(await fs$18.promises.lstat(filePath)).isFile()) return;
25207
- const responseString = await fs$18.promises.readFile(filePath, { encoding: "utf8" });
25206
+ if (!(await fs$19.promises.lstat(filePath)).isFile()) return;
25207
+ const responseString = await fs$19.promises.readFile(filePath, { encoding: "utf8" });
25208
25208
  if (responseString === "") return;
25209
25209
  try {
25210
25210
  const responseJson = JSON.parse(responseString);
@@ -25626,11 +25626,11 @@ var require_googleauth = /* @__PURE__ */ __commonJSMin(((exports) => {
25626
25626
  Object.defineProperty(exports, "__esModule", { value: true });
25627
25627
  exports.GoogleAuth = exports.GoogleAuthExceptionMessages = void 0;
25628
25628
  const child_process_1 = __require("child_process");
25629
- const fs$17 = __require("fs");
25629
+ const fs$18 = __require("fs");
25630
25630
  const gaxios_1 = require_src$4();
25631
25631
  const gcpMetadata = require_src$2();
25632
25632
  const os$6 = __require("os");
25633
- const path$17 = __require("path");
25633
+ const path$18 = __require("path");
25634
25634
  const crypto_1 = require_crypto();
25635
25635
  const computeclient_1 = require_computeclient();
25636
25636
  const idtokenclient_1 = require_idtokenclient();
@@ -25870,11 +25870,11 @@ var require_googleauth = /* @__PURE__ */ __commonJSMin(((exports) => {
25870
25870
  if (this._isWindows()) location = process.env["APPDATA"];
25871
25871
  else {
25872
25872
  const home = process.env["HOME"];
25873
- if (home) location = path$17.join(home, ".config");
25873
+ if (home) location = path$18.join(home, ".config");
25874
25874
  }
25875
25875
  if (location) {
25876
- location = path$17.join(location, "gcloud", "application_default_credentials.json");
25877
- if (!fs$17.existsSync(location)) location = null;
25876
+ location = path$18.join(location, "gcloud", "application_default_credentials.json");
25877
+ if (!fs$18.existsSync(location)) location = null;
25878
25878
  }
25879
25879
  if (!location) return null;
25880
25880
  return await this._getApplicationCredentialsFromFilePath(location, options);
@@ -25888,13 +25888,13 @@ var require_googleauth = /* @__PURE__ */ __commonJSMin(((exports) => {
25888
25888
  async _getApplicationCredentialsFromFilePath(filePath, options = {}) {
25889
25889
  if (!filePath || filePath.length === 0) throw new Error("The file path is invalid.");
25890
25890
  try {
25891
- filePath = fs$17.realpathSync(filePath);
25892
- if (!fs$17.lstatSync(filePath).isFile()) throw new Error();
25891
+ filePath = fs$18.realpathSync(filePath);
25892
+ if (!fs$18.lstatSync(filePath).isFile()) throw new Error();
25893
25893
  } catch (err) {
25894
25894
  if (err instanceof Error) err.message = `The file at ${filePath} does not exist, or it is not a file. ${err.message}`;
25895
25895
  throw err;
25896
25896
  }
25897
- const readStream = fs$17.createReadStream(filePath);
25897
+ const readStream = fs$18.createReadStream(filePath);
25898
25898
  return this.fromStream(readStream, options);
25899
25899
  }
25900
25900
  /**
@@ -26160,8 +26160,8 @@ var require_googleauth = /* @__PURE__ */ __commonJSMin(((exports) => {
26160
26160
  async #determineClient() {
26161
26161
  if (this.jsonContent) return this._cacheClientFromJSON(this.jsonContent, this.clientOptions);
26162
26162
  else if (this.keyFilename) {
26163
- const filePath = path$17.resolve(this.keyFilename);
26164
- const stream = fs$17.createReadStream(filePath);
26163
+ const filePath = path$18.resolve(this.keyFilename);
26164
+ const stream = fs$18.createReadStream(filePath);
26165
26165
  return await this.fromStreamAsync(stream, this.clientOptions);
26166
26166
  } else if (this.apiKey) {
26167
26167
  const client = await this.fromAPIKey(this.apiKey, this.clientOptions);
@@ -37183,7 +37183,7 @@ function getApiKeyFromEnv() {
37183
37183
  if (envGoogleApiKey && envGeminiApiKey) console.warn("Both GOOGLE_API_KEY and GEMINI_API_KEY are set. Using GOOGLE_API_KEY.");
37184
37184
  return envGoogleApiKey || envGeminiApiKey || void 0;
37185
37185
  }
37186
- var import_p_retry, import_src$2, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, HttpResponse, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosOperation, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, ListBatchJobsResponse, LiveServerMessage, LiveMusicServerMessage, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches$1, Caches, Chats, Chat$1, ApiError, Files$3, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session$2, DEFAULT_MAX_REMOTE_CALLS, Models$1, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4$1, castToError$1, GeminiNextGenAPIClientError, APIError$1, APIUserAbortError$1, APIConnectionError$1, APIConnectionTimeoutError$1, BadRequestError$1, AuthenticationError$1, PermissionDeniedError$1, NotFoundError$1, ConflictError$1, UnprocessableEntityError$1, RateLimitError$1, InternalServerError$1, startsWithSchemeRegexp$1, isAbsoluteURL$1, isArrayInternal, isReadonlyArray$1, validatePositiveInteger$1, safeJSON$1, sleep$1$1, FallbackEncoder$1, VERSION$1, checkFileSupport$1, isAsyncIterable$1, isBlobLike$1, isFileLike$1, isResponseLike$1, APIResource$1, EMPTY$2, createPathTagFunction$1, path$16, BaseInteractions, Interactions, encodeUTF8_$1, decodeUTF8_$1, LineDecoder$1, levelNumbers$1, parseLogLevel$2, noopLogger$1, cachedLoggers$1, formatRequestDetails$1, Stream$5, SSEDecoder$1, APIPromise$1, brand_privateNullableHeaders$1, buildHeaders$1, readEnv$1, _a$4, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
37186
+ var import_p_retry, import_src$2, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, HttpResponse, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosOperation, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, ListBatchJobsResponse, LiveServerMessage, LiveMusicServerMessage, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches$1, Caches, Chats, Chat$1, ApiError, Files$3, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session$2, DEFAULT_MAX_REMOTE_CALLS, Models$1, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4$1, castToError$1, GeminiNextGenAPIClientError, APIError$1, APIUserAbortError$1, APIConnectionError$1, APIConnectionTimeoutError$1, BadRequestError$1, AuthenticationError$1, PermissionDeniedError$1, NotFoundError$1, ConflictError$1, UnprocessableEntityError$1, RateLimitError$1, InternalServerError$1, startsWithSchemeRegexp$1, isAbsoluteURL$1, isArrayInternal, isReadonlyArray$1, validatePositiveInteger$1, safeJSON$1, sleep$1$1, FallbackEncoder$1, VERSION$1, checkFileSupport$1, isAsyncIterable$1, isBlobLike$1, isFileLike$1, isResponseLike$1, APIResource$1, EMPTY$2, createPathTagFunction$1, path$17, BaseInteractions, Interactions, encodeUTF8_$1, decodeUTF8_$1, LineDecoder$1, levelNumbers$1, parseLogLevel$2, noopLogger$1, cachedLoggers$1, formatRequestDetails$1, Stream$5, SSEDecoder$1, APIPromise$1, brand_privateNullableHeaders$1, buildHeaders$1, readEnv$1, _a$4, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
37187
37187
  var init_node$6 = __esmMin((() => {
37188
37188
  import_p_retry = /* @__PURE__ */ __toESM(require_p_retry(), 1);
37189
37189
  import_src$2 = require_src$1();
@@ -43280,14 +43280,14 @@ var init_node$6 = __esmMin((() => {
43280
43280
  }
43281
43281
  return path;
43282
43282
  });
43283
- path$16 = /* @__PURE__ */ createPathTagFunction$1(encodeURIPath$1);
43283
+ path$17 = /* @__PURE__ */ createPathTagFunction$1(encodeURIPath$1);
43284
43284
  BaseInteractions = class extends APIResource$1 {
43285
43285
  create(params, options) {
43286
43286
  var _a;
43287
43287
  const { api_version = this._client.apiVersion } = params, body = __rest(params, ["api_version"]);
43288
43288
  if ("model" in body && "agent_config" in body) throw new GeminiNextGenAPIClientError(`Invalid request: specified \`model\` and \`agent_config\`. If specifying \`model\`, use \`generation_config\`.`);
43289
43289
  if ("agent" in body && "generation_config" in body) throw new GeminiNextGenAPIClientError(`Invalid request: specified \`agent\` and \`generation_config\`. If specifying \`agent\`, use \`agent_config\`.`);
43290
- return this._client.post(path$16`/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a = params.stream) !== null && _a !== void 0 ? _a : false }));
43290
+ return this._client.post(path$17`/${api_version}/interactions`, Object.assign(Object.assign({ body }, options), { stream: (_a = params.stream) !== null && _a !== void 0 ? _a : false }));
43291
43291
  }
43292
43292
  /**
43293
43293
  * Deletes the interaction by id.
@@ -43301,7 +43301,7 @@ var init_node$6 = __esmMin((() => {
43301
43301
  */
43302
43302
  delete(id, params = {}, options) {
43303
43303
  const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
43304
- return this._client.delete(path$16`/${api_version}/interactions/${id}`, options);
43304
+ return this._client.delete(path$17`/${api_version}/interactions/${id}`, options);
43305
43305
  }
43306
43306
  /**
43307
43307
  * Cancels an interaction by id. This only applies to background interactions that
@@ -43316,12 +43316,12 @@ var init_node$6 = __esmMin((() => {
43316
43316
  */
43317
43317
  cancel(id, params = {}, options) {
43318
43318
  const { api_version = this._client.apiVersion } = params !== null && params !== void 0 ? params : {};
43319
- return this._client.post(path$16`/${api_version}/interactions/${id}/cancel`, options);
43319
+ return this._client.post(path$17`/${api_version}/interactions/${id}/cancel`, options);
43320
43320
  }
43321
43321
  get(id, params = {}, options) {
43322
43322
  var _a;
43323
43323
  const _b = params !== null && params !== void 0 ? params : {}, { api_version = this._client.apiVersion } = _b, query = __rest(_b, ["api_version"]);
43324
- return this._client.get(path$16`/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a = params === null || params === void 0 ? void 0 : params.stream) !== null && _a !== void 0 ? _a : false }));
43324
+ return this._client.get(path$17`/${api_version}/interactions/${id}`, Object.assign(Object.assign({ query }, options), { stream: (_a = params === null || params === void 0 ? void 0 : params.stream) !== null && _a !== void 0 ? _a : false }));
43325
43325
  }
43326
43326
  };
43327
43327
  BaseInteractions._key = Object.freeze(["interactions"]);
@@ -44474,7 +44474,7 @@ var init_node$6 = __esmMin((() => {
44474
44474
  type: void 0
44475
44475
  };
44476
44476
  if (typeof file === "string") {
44477
- fileStat.size = (await fs$16.stat(file)).size;
44477
+ fileStat.size = (await fs$17.stat(file)).size;
44478
44478
  fileStat.type = this.inferMimeType(file);
44479
44479
  return fileStat;
44480
44480
  } else return await getBlobStat(file);
@@ -44606,7 +44606,7 @@ var init_node$6 = __esmMin((() => {
44606
44606
  let fileHandle;
44607
44607
  const fileName = path$1$1.basename(file);
44608
44608
  try {
44609
- fileHandle = await fs$16.open(file, "r");
44609
+ fileHandle = await fs$17.open(file, "r");
44610
44610
  if (!fileHandle) throw new Error(`Failed to open file`);
44611
44611
  fileSize = (await fileHandle.stat()).size;
44612
44612
  while (offset < fileSize) {
@@ -47272,7 +47272,7 @@ var init_resource = __esmMin((() => {
47272
47272
  function encodeURIPath(str) {
47273
47273
  return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
47274
47274
  }
47275
- var EMPTY$1, createPathTagFunction, path$15;
47275
+ var EMPTY$1, createPathTagFunction, path$16;
47276
47276
  var init_path$1 = __esmMin((() => {
47277
47277
  init_error$2();
47278
47278
  EMPTY$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
@@ -47315,7 +47315,7 @@ var init_path$1 = __esmMin((() => {
47315
47315
  }
47316
47316
  return path;
47317
47317
  };
47318
- path$15 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
47318
+ path$16 = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
47319
47319
  }));
47320
47320
  //#endregion
47321
47321
  //#region ../../node_modules/.pnpm/openai@6.34.0_ws@8.20.0_zod@4.3.6/node_modules/openai/resources/chat/completions/messages.mjs
@@ -47340,7 +47340,7 @@ var init_messages$1 = __esmMin((() => {
47340
47340
  * ```
47341
47341
  */
47342
47342
  list(completionID, query = {}, options) {
47343
- return this._client.getAPIList(path$15`/chat/completions/${completionID}/messages`, CursorPage, {
47343
+ return this._client.getAPIList(path$16`/chat/completions/${completionID}/messages`, CursorPage, {
47344
47344
  query,
47345
47345
  ...options
47346
47346
  });
@@ -48565,7 +48565,7 @@ var init_completions$2 = __esmMin((() => {
48565
48565
  * ```
48566
48566
  */
48567
48567
  retrieve(completionID, options) {
48568
- return this._client.get(path$15`/chat/completions/${completionID}`, options);
48568
+ return this._client.get(path$16`/chat/completions/${completionID}`, options);
48569
48569
  }
48570
48570
  /**
48571
48571
  * Modify a stored chat completion. Only Chat Completions that have been created
@@ -48581,7 +48581,7 @@ var init_completions$2 = __esmMin((() => {
48581
48581
  * ```
48582
48582
  */
48583
48583
  update(completionID, body, options) {
48584
- return this._client.post(path$15`/chat/completions/${completionID}`, {
48584
+ return this._client.post(path$16`/chat/completions/${completionID}`, {
48585
48585
  body,
48586
48586
  ...options
48587
48587
  });
@@ -48615,7 +48615,7 @@ var init_completions$2 = __esmMin((() => {
48615
48615
  * ```
48616
48616
  */
48617
48617
  delete(completionID, options) {
48618
- return this._client.delete(path$15`/chat/completions/${completionID}`, options);
48618
+ return this._client.delete(path$16`/chat/completions/${completionID}`, options);
48619
48619
  }
48620
48620
  parse(body, options) {
48621
48621
  validateInputTools(body.tools);
@@ -48842,7 +48842,7 @@ var init_batches = __esmMin((() => {
48842
48842
  * Retrieves a batch.
48843
48843
  */
48844
48844
  retrieve(batchID, options) {
48845
- return this._client.get(path$15`/batches/${batchID}`, options);
48845
+ return this._client.get(path$16`/batches/${batchID}`, options);
48846
48846
  }
48847
48847
  /**
48848
48848
  * List your organization's batches.
@@ -48859,7 +48859,7 @@ var init_batches = __esmMin((() => {
48859
48859
  * (if any) available in the output file.
48860
48860
  */
48861
48861
  cancel(batchID, options) {
48862
- return this._client.post(path$15`/batches/${batchID}/cancel`, options);
48862
+ return this._client.post(path$16`/batches/${batchID}/cancel`, options);
48863
48863
  }
48864
48864
  };
48865
48865
  }));
@@ -48890,7 +48890,7 @@ var init_assistants = __esmMin((() => {
48890
48890
  * @deprecated
48891
48891
  */
48892
48892
  retrieve(assistantID, options) {
48893
- return this._client.get(path$15`/assistants/${assistantID}`, {
48893
+ return this._client.get(path$16`/assistants/${assistantID}`, {
48894
48894
  ...options,
48895
48895
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
48896
48896
  });
@@ -48901,7 +48901,7 @@ var init_assistants = __esmMin((() => {
48901
48901
  * @deprecated
48902
48902
  */
48903
48903
  update(assistantID, body, options) {
48904
- return this._client.post(path$15`/assistants/${assistantID}`, {
48904
+ return this._client.post(path$16`/assistants/${assistantID}`, {
48905
48905
  body,
48906
48906
  ...options,
48907
48907
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -48925,7 +48925,7 @@ var init_assistants = __esmMin((() => {
48925
48925
  * @deprecated
48926
48926
  */
48927
48927
  delete(assistantID, options) {
48928
- return this._client.delete(path$15`/assistants/${assistantID}`, {
48928
+ return this._client.delete(path$16`/assistants/${assistantID}`, {
48929
48929
  ...options,
48930
48930
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
48931
48931
  });
@@ -49050,7 +49050,7 @@ var init_sessions$1 = __esmMin((() => {
49050
49050
  * ```
49051
49051
  */
49052
49052
  cancel(sessionID, options) {
49053
- return this._client.post(path$15`/chatkit/sessions/${sessionID}/cancel`, {
49053
+ return this._client.post(path$16`/chatkit/sessions/${sessionID}/cancel`, {
49054
49054
  ...options,
49055
49055
  headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
49056
49056
  });
@@ -49076,7 +49076,7 @@ var init_threads$1 = __esmMin((() => {
49076
49076
  * ```
49077
49077
  */
49078
49078
  retrieve(threadID, options) {
49079
- return this._client.get(path$15`/chatkit/threads/${threadID}`, {
49079
+ return this._client.get(path$16`/chatkit/threads/${threadID}`, {
49080
49080
  ...options,
49081
49081
  headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
49082
49082
  });
@@ -49110,7 +49110,7 @@ var init_threads$1 = __esmMin((() => {
49110
49110
  * ```
49111
49111
  */
49112
49112
  delete(threadID, options) {
49113
- return this._client.delete(path$15`/chatkit/threads/${threadID}`, {
49113
+ return this._client.delete(path$16`/chatkit/threads/${threadID}`, {
49114
49114
  ...options,
49115
49115
  headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
49116
49116
  });
@@ -49129,7 +49129,7 @@ var init_threads$1 = __esmMin((() => {
49129
49129
  * ```
49130
49130
  */
49131
49131
  listItems(threadID, query = {}, options) {
49132
- return this._client.getAPIList(path$15`/chatkit/threads/${threadID}/items`, ConversationCursorPage, {
49132
+ return this._client.getAPIList(path$16`/chatkit/threads/${threadID}/items`, ConversationCursorPage, {
49133
49133
  query,
49134
49134
  ...options,
49135
49135
  headers: buildHeaders([{ "OpenAI-Beta": "chatkit_beta=v1" }, options?.headers])
@@ -49169,7 +49169,7 @@ var init_messages = __esmMin((() => {
49169
49169
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49170
49170
  */
49171
49171
  create(threadID, body, options) {
49172
- return this._client.post(path$15`/threads/${threadID}/messages`, {
49172
+ return this._client.post(path$16`/threads/${threadID}/messages`, {
49173
49173
  body,
49174
49174
  ...options,
49175
49175
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49182,7 +49182,7 @@ var init_messages = __esmMin((() => {
49182
49182
  */
49183
49183
  retrieve(messageID, params, options) {
49184
49184
  const { thread_id } = params;
49185
- return this._client.get(path$15`/threads/${thread_id}/messages/${messageID}`, {
49185
+ return this._client.get(path$16`/threads/${thread_id}/messages/${messageID}`, {
49186
49186
  ...options,
49187
49187
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
49188
49188
  });
@@ -49194,7 +49194,7 @@ var init_messages = __esmMin((() => {
49194
49194
  */
49195
49195
  update(messageID, params, options) {
49196
49196
  const { thread_id, ...body } = params;
49197
- return this._client.post(path$15`/threads/${thread_id}/messages/${messageID}`, {
49197
+ return this._client.post(path$16`/threads/${thread_id}/messages/${messageID}`, {
49198
49198
  body,
49199
49199
  ...options,
49200
49200
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49206,7 +49206,7 @@ var init_messages = __esmMin((() => {
49206
49206
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49207
49207
  */
49208
49208
  list(threadID, query = {}, options) {
49209
- return this._client.getAPIList(path$15`/threads/${threadID}/messages`, CursorPage, {
49209
+ return this._client.getAPIList(path$16`/threads/${threadID}/messages`, CursorPage, {
49210
49210
  query,
49211
49211
  ...options,
49212
49212
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49219,7 +49219,7 @@ var init_messages = __esmMin((() => {
49219
49219
  */
49220
49220
  delete(messageID, params, options) {
49221
49221
  const { thread_id } = params;
49222
- return this._client.delete(path$15`/threads/${thread_id}/messages/${messageID}`, {
49222
+ return this._client.delete(path$16`/threads/${thread_id}/messages/${messageID}`, {
49223
49223
  ...options,
49224
49224
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
49225
49225
  });
@@ -49242,7 +49242,7 @@ var init_steps = __esmMin((() => {
49242
49242
  */
49243
49243
  retrieve(stepID, params, options) {
49244
49244
  const { thread_id, run_id, ...query } = params;
49245
- return this._client.get(path$15`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
49245
+ return this._client.get(path$16`/threads/${thread_id}/runs/${run_id}/steps/${stepID}`, {
49246
49246
  query,
49247
49247
  ...options,
49248
49248
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49255,7 +49255,7 @@ var init_steps = __esmMin((() => {
49255
49255
  */
49256
49256
  list(runID, params, options) {
49257
49257
  const { thread_id, ...query } = params;
49258
- return this._client.getAPIList(path$15`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
49258
+ return this._client.getAPIList(path$16`/threads/${thread_id}/runs/${runID}/steps`, CursorPage, {
49259
49259
  query,
49260
49260
  ...options,
49261
49261
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49787,7 +49787,7 @@ var init_runs$1 = __esmMin((() => {
49787
49787
  }
49788
49788
  create(threadID, params, options) {
49789
49789
  const { include, ...body } = params;
49790
- return this._client.post(path$15`/threads/${threadID}/runs`, {
49790
+ return this._client.post(path$16`/threads/${threadID}/runs`, {
49791
49791
  query: { include },
49792
49792
  body,
49793
49793
  ...options,
@@ -49803,7 +49803,7 @@ var init_runs$1 = __esmMin((() => {
49803
49803
  */
49804
49804
  retrieve(runID, params, options) {
49805
49805
  const { thread_id } = params;
49806
- return this._client.get(path$15`/threads/${thread_id}/runs/${runID}`, {
49806
+ return this._client.get(path$16`/threads/${thread_id}/runs/${runID}`, {
49807
49807
  ...options,
49808
49808
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
49809
49809
  });
@@ -49815,7 +49815,7 @@ var init_runs$1 = __esmMin((() => {
49815
49815
  */
49816
49816
  update(runID, params, options) {
49817
49817
  const { thread_id, ...body } = params;
49818
- return this._client.post(path$15`/threads/${thread_id}/runs/${runID}`, {
49818
+ return this._client.post(path$16`/threads/${thread_id}/runs/${runID}`, {
49819
49819
  body,
49820
49820
  ...options,
49821
49821
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49827,7 +49827,7 @@ var init_runs$1 = __esmMin((() => {
49827
49827
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49828
49828
  */
49829
49829
  list(threadID, query = {}, options) {
49830
- return this._client.getAPIList(path$15`/threads/${threadID}/runs`, CursorPage, {
49830
+ return this._client.getAPIList(path$16`/threads/${threadID}/runs`, CursorPage, {
49831
49831
  query,
49832
49832
  ...options,
49833
49833
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49840,7 +49840,7 @@ var init_runs$1 = __esmMin((() => {
49840
49840
  */
49841
49841
  cancel(runID, params, options) {
49842
49842
  const { thread_id } = params;
49843
- return this._client.post(path$15`/threads/${thread_id}/runs/${runID}/cancel`, {
49843
+ return this._client.post(path$16`/threads/${thread_id}/runs/${runID}/cancel`, {
49844
49844
  ...options,
49845
49845
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
49846
49846
  });
@@ -49912,7 +49912,7 @@ var init_runs$1 = __esmMin((() => {
49912
49912
  }
49913
49913
  submitToolOutputs(runID, params, options) {
49914
49914
  const { thread_id, ...body } = params;
49915
- return this._client.post(path$15`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
49915
+ return this._client.post(path$16`/threads/${thread_id}/runs/${runID}/submit_tool_outputs`, {
49916
49916
  body,
49917
49917
  ...options,
49918
49918
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers]),
@@ -49974,7 +49974,7 @@ var init_threads = __esmMin((() => {
49974
49974
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49975
49975
  */
49976
49976
  retrieve(threadID, options) {
49977
- return this._client.get(path$15`/threads/${threadID}`, {
49977
+ return this._client.get(path$16`/threads/${threadID}`, {
49978
49978
  ...options,
49979
49979
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
49980
49980
  });
@@ -49985,7 +49985,7 @@ var init_threads = __esmMin((() => {
49985
49985
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49986
49986
  */
49987
49987
  update(threadID, body, options) {
49988
- return this._client.post(path$15`/threads/${threadID}`, {
49988
+ return this._client.post(path$16`/threads/${threadID}`, {
49989
49989
  body,
49990
49990
  ...options,
49991
49991
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -49997,7 +49997,7 @@ var init_threads = __esmMin((() => {
49997
49997
  * @deprecated The Assistants API is deprecated in favor of the Responses API
49998
49998
  */
49999
49999
  delete(threadID, options) {
50000
- return this._client.delete(path$15`/threads/${threadID}`, {
50000
+ return this._client.delete(path$16`/threads/${threadID}`, {
50001
50001
  ...options,
50002
50002
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
50003
50003
  });
@@ -50081,7 +50081,7 @@ var init_content$2 = __esmMin((() => {
50081
50081
  */
50082
50082
  retrieve(fileID, params, options) {
50083
50083
  const { container_id } = params;
50084
- return this._client.get(path$15`/containers/${container_id}/files/${fileID}/content`, {
50084
+ return this._client.get(path$16`/containers/${container_id}/files/${fileID}/content`, {
50085
50085
  ...options,
50086
50086
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
50087
50087
  __binaryResponse: true
@@ -50111,7 +50111,7 @@ var init_files$2 = __esmMin((() => {
50111
50111
  * a JSON request with a file ID.
50112
50112
  */
50113
50113
  create(containerID, body, options) {
50114
- return this._client.post(path$15`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({
50114
+ return this._client.post(path$16`/containers/${containerID}/files`, maybeMultipartFormRequestOptions({
50115
50115
  body,
50116
50116
  ...options
50117
50117
  }, this._client));
@@ -50121,13 +50121,13 @@ var init_files$2 = __esmMin((() => {
50121
50121
  */
50122
50122
  retrieve(fileID, params, options) {
50123
50123
  const { container_id } = params;
50124
- return this._client.get(path$15`/containers/${container_id}/files/${fileID}`, options);
50124
+ return this._client.get(path$16`/containers/${container_id}/files/${fileID}`, options);
50125
50125
  }
50126
50126
  /**
50127
50127
  * List Container files
50128
50128
  */
50129
50129
  list(containerID, query = {}, options) {
50130
- return this._client.getAPIList(path$15`/containers/${containerID}/files`, CursorPage, {
50130
+ return this._client.getAPIList(path$16`/containers/${containerID}/files`, CursorPage, {
50131
50131
  query,
50132
50132
  ...options
50133
50133
  });
@@ -50137,7 +50137,7 @@ var init_files$2 = __esmMin((() => {
50137
50137
  */
50138
50138
  delete(fileID, params, options) {
50139
50139
  const { container_id } = params;
50140
- return this._client.delete(path$15`/containers/${container_id}/files/${fileID}`, {
50140
+ return this._client.delete(path$16`/containers/${container_id}/files/${fileID}`, {
50141
50141
  ...options,
50142
50142
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
50143
50143
  });
@@ -50172,7 +50172,7 @@ var init_containers = __esmMin((() => {
50172
50172
  * Retrieve Container
50173
50173
  */
50174
50174
  retrieve(containerID, options) {
50175
- return this._client.get(path$15`/containers/${containerID}`, options);
50175
+ return this._client.get(path$16`/containers/${containerID}`, options);
50176
50176
  }
50177
50177
  /**
50178
50178
  * List Containers
@@ -50187,7 +50187,7 @@ var init_containers = __esmMin((() => {
50187
50187
  * Delete Container
50188
50188
  */
50189
50189
  delete(containerID, options) {
50190
- return this._client.delete(path$15`/containers/${containerID}`, {
50190
+ return this._client.delete(path$16`/containers/${containerID}`, {
50191
50191
  ...options,
50192
50192
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
50193
50193
  });
@@ -50208,7 +50208,7 @@ var init_items = __esmMin((() => {
50208
50208
  */
50209
50209
  create(conversationID, params, options) {
50210
50210
  const { include, ...body } = params;
50211
- return this._client.post(path$15`/conversations/${conversationID}/items`, {
50211
+ return this._client.post(path$16`/conversations/${conversationID}/items`, {
50212
50212
  query: { include },
50213
50213
  body,
50214
50214
  ...options
@@ -50219,7 +50219,7 @@ var init_items = __esmMin((() => {
50219
50219
  */
50220
50220
  retrieve(itemID, params, options) {
50221
50221
  const { conversation_id, ...query } = params;
50222
- return this._client.get(path$15`/conversations/${conversation_id}/items/${itemID}`, {
50222
+ return this._client.get(path$16`/conversations/${conversation_id}/items/${itemID}`, {
50223
50223
  query,
50224
50224
  ...options
50225
50225
  });
@@ -50228,7 +50228,7 @@ var init_items = __esmMin((() => {
50228
50228
  * List all items for a conversation with the given ID.
50229
50229
  */
50230
50230
  list(conversationID, query = {}, options) {
50231
- return this._client.getAPIList(path$15`/conversations/${conversationID}/items`, ConversationCursorPage, {
50231
+ return this._client.getAPIList(path$16`/conversations/${conversationID}/items`, ConversationCursorPage, {
50232
50232
  query,
50233
50233
  ...options
50234
50234
  });
@@ -50238,7 +50238,7 @@ var init_items = __esmMin((() => {
50238
50238
  */
50239
50239
  delete(itemID, params, options) {
50240
50240
  const { conversation_id } = params;
50241
- return this._client.delete(path$15`/conversations/${conversation_id}/items/${itemID}`, options);
50241
+ return this._client.delete(path$16`/conversations/${conversation_id}/items/${itemID}`, options);
50242
50242
  }
50243
50243
  };
50244
50244
  }));
@@ -50267,13 +50267,13 @@ var init_conversations = __esmMin((() => {
50267
50267
  * Get a conversation
50268
50268
  */
50269
50269
  retrieve(conversationID, options) {
50270
- return this._client.get(path$15`/conversations/${conversationID}`, options);
50270
+ return this._client.get(path$16`/conversations/${conversationID}`, options);
50271
50271
  }
50272
50272
  /**
50273
50273
  * Update a conversation
50274
50274
  */
50275
50275
  update(conversationID, body, options) {
50276
- return this._client.post(path$15`/conversations/${conversationID}`, {
50276
+ return this._client.post(path$16`/conversations/${conversationID}`, {
50277
50277
  body,
50278
50278
  ...options
50279
50279
  });
@@ -50282,7 +50282,7 @@ var init_conversations = __esmMin((() => {
50282
50282
  * Delete a conversation. Items in the conversation will not be deleted.
50283
50283
  */
50284
50284
  delete(conversationID, options) {
50285
- return this._client.delete(path$15`/conversations/${conversationID}`, options);
50285
+ return this._client.delete(path$16`/conversations/${conversationID}`, options);
50286
50286
  }
50287
50287
  };
50288
50288
  Conversations.Items = Items;
@@ -50342,14 +50342,14 @@ var init_output_items = __esmMin((() => {
50342
50342
  */
50343
50343
  retrieve(outputItemID, params, options) {
50344
50344
  const { eval_id, run_id } = params;
50345
- return this._client.get(path$15`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
50345
+ return this._client.get(path$16`/evals/${eval_id}/runs/${run_id}/output_items/${outputItemID}`, options);
50346
50346
  }
50347
50347
  /**
50348
50348
  * Get a list of output items for an evaluation run.
50349
50349
  */
50350
50350
  list(runID, params, options) {
50351
50351
  const { eval_id, ...query } = params;
50352
- return this._client.getAPIList(path$15`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, {
50352
+ return this._client.getAPIList(path$16`/evals/${eval_id}/runs/${runID}/output_items`, CursorPage, {
50353
50353
  query,
50354
50354
  ...options
50355
50355
  });
@@ -50375,7 +50375,7 @@ var init_runs = __esmMin((() => {
50375
50375
  * schema specified in the config of the evaluation.
50376
50376
  */
50377
50377
  create(evalID, body, options) {
50378
- return this._client.post(path$15`/evals/${evalID}/runs`, {
50378
+ return this._client.post(path$16`/evals/${evalID}/runs`, {
50379
50379
  body,
50380
50380
  ...options
50381
50381
  });
@@ -50385,13 +50385,13 @@ var init_runs = __esmMin((() => {
50385
50385
  */
50386
50386
  retrieve(runID, params, options) {
50387
50387
  const { eval_id } = params;
50388
- return this._client.get(path$15`/evals/${eval_id}/runs/${runID}`, options);
50388
+ return this._client.get(path$16`/evals/${eval_id}/runs/${runID}`, options);
50389
50389
  }
50390
50390
  /**
50391
50391
  * Get a list of runs for an evaluation.
50392
50392
  */
50393
50393
  list(evalID, query = {}, options) {
50394
- return this._client.getAPIList(path$15`/evals/${evalID}/runs`, CursorPage, {
50394
+ return this._client.getAPIList(path$16`/evals/${evalID}/runs`, CursorPage, {
50395
50395
  query,
50396
50396
  ...options
50397
50397
  });
@@ -50401,14 +50401,14 @@ var init_runs = __esmMin((() => {
50401
50401
  */
50402
50402
  delete(runID, params, options) {
50403
50403
  const { eval_id } = params;
50404
- return this._client.delete(path$15`/evals/${eval_id}/runs/${runID}`, options);
50404
+ return this._client.delete(path$16`/evals/${eval_id}/runs/${runID}`, options);
50405
50405
  }
50406
50406
  /**
50407
50407
  * Cancel an ongoing evaluation run.
50408
50408
  */
50409
50409
  cancel(runID, params, options) {
50410
50410
  const { eval_id } = params;
50411
- return this._client.post(path$15`/evals/${eval_id}/runs/${runID}`, options);
50411
+ return this._client.post(path$16`/evals/${eval_id}/runs/${runID}`, options);
50412
50412
  }
50413
50413
  };
50414
50414
  Runs.OutputItems = OutputItems;
@@ -50444,13 +50444,13 @@ var init_evals = __esmMin((() => {
50444
50444
  * Get an evaluation by ID.
50445
50445
  */
50446
50446
  retrieve(evalID, options) {
50447
- return this._client.get(path$15`/evals/${evalID}`, options);
50447
+ return this._client.get(path$16`/evals/${evalID}`, options);
50448
50448
  }
50449
50449
  /**
50450
50450
  * Update certain properties of an evaluation.
50451
50451
  */
50452
50452
  update(evalID, body, options) {
50453
- return this._client.post(path$15`/evals/${evalID}`, {
50453
+ return this._client.post(path$16`/evals/${evalID}`, {
50454
50454
  body,
50455
50455
  ...options
50456
50456
  });
@@ -50468,7 +50468,7 @@ var init_evals = __esmMin((() => {
50468
50468
  * Delete an evaluation.
50469
50469
  */
50470
50470
  delete(evalID, options) {
50471
- return this._client.delete(path$15`/evals/${evalID}`, options);
50471
+ return this._client.delete(path$16`/evals/${evalID}`, options);
50472
50472
  }
50473
50473
  };
50474
50474
  Evals.Runs = Runs;
@@ -50517,7 +50517,7 @@ var init_files$1 = __esmMin((() => {
50517
50517
  * Returns information about a specific file.
50518
50518
  */
50519
50519
  retrieve(fileID, options) {
50520
- return this._client.get(path$15`/files/${fileID}`, options);
50520
+ return this._client.get(path$16`/files/${fileID}`, options);
50521
50521
  }
50522
50522
  /**
50523
50523
  * Returns a list of files.
@@ -50532,13 +50532,13 @@ var init_files$1 = __esmMin((() => {
50532
50532
  * Delete a file and remove it from all vector stores.
50533
50533
  */
50534
50534
  delete(fileID, options) {
50535
- return this._client.delete(path$15`/files/${fileID}`, options);
50535
+ return this._client.delete(path$16`/files/${fileID}`, options);
50536
50536
  }
50537
50537
  /**
50538
50538
  * Returns the contents of the specified file.
50539
50539
  */
50540
50540
  content(fileID, options) {
50541
- return this._client.get(path$15`/files/${fileID}/content`, {
50541
+ return this._client.get(path$16`/files/${fileID}/content`, {
50542
50542
  ...options,
50543
50543
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
50544
50544
  __binaryResponse: true
@@ -50665,7 +50665,7 @@ var init_permissions = __esmMin((() => {
50665
50665
  * ```
50666
50666
  */
50667
50667
  create(fineTunedModelCheckpoint, body, options) {
50668
- return this._client.getAPIList(path$15`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, {
50668
+ return this._client.getAPIList(path$16`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, {
50669
50669
  body,
50670
50670
  method: "post",
50671
50671
  ...options
@@ -50680,7 +50680,7 @@ var init_permissions = __esmMin((() => {
50680
50680
  * @deprecated Retrieve is deprecated. Please swap to the paginated list method instead.
50681
50681
  */
50682
50682
  retrieve(fineTunedModelCheckpoint, query = {}, options) {
50683
- return this._client.get(path$15`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
50683
+ return this._client.get(path$16`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, {
50684
50684
  query,
50685
50685
  ...options
50686
50686
  });
@@ -50702,7 +50702,7 @@ var init_permissions = __esmMin((() => {
50702
50702
  * ```
50703
50703
  */
50704
50704
  list(fineTunedModelCheckpoint, query = {}, options) {
50705
- return this._client.getAPIList(path$15`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, {
50705
+ return this._client.getAPIList(path$16`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, ConversationCursorPage, {
50706
50706
  query,
50707
50707
  ...options
50708
50708
  });
@@ -50727,7 +50727,7 @@ var init_permissions = __esmMin((() => {
50727
50727
  */
50728
50728
  delete(permissionID, params, options) {
50729
50729
  const { fine_tuned_model_checkpoint } = params;
50730
- return this._client.delete(path$15`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
50730
+ return this._client.delete(path$16`/fine_tuning/checkpoints/${fine_tuned_model_checkpoint}/permissions/${permissionID}`, options);
50731
50731
  }
50732
50732
  };
50733
50733
  }));
@@ -50767,7 +50767,7 @@ var init_checkpoints = __esmMin((() => {
50767
50767
  * ```
50768
50768
  */
50769
50769
  list(fineTuningJobID, query = {}, options) {
50770
- return this._client.getAPIList(path$15`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, {
50770
+ return this._client.getAPIList(path$16`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, {
50771
50771
  query,
50772
50772
  ...options
50773
50773
  });
@@ -50823,7 +50823,7 @@ var init_jobs = __esmMin((() => {
50823
50823
  * ```
50824
50824
  */
50825
50825
  retrieve(fineTuningJobID, options) {
50826
- return this._client.get(path$15`/fine_tuning/jobs/${fineTuningJobID}`, options);
50826
+ return this._client.get(path$16`/fine_tuning/jobs/${fineTuningJobID}`, options);
50827
50827
  }
50828
50828
  /**
50829
50829
  * List your organization's fine-tuning jobs
@@ -50853,7 +50853,7 @@ var init_jobs = __esmMin((() => {
50853
50853
  * ```
50854
50854
  */
50855
50855
  cancel(fineTuningJobID, options) {
50856
- return this._client.post(path$15`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
50856
+ return this._client.post(path$16`/fine_tuning/jobs/${fineTuningJobID}/cancel`, options);
50857
50857
  }
50858
50858
  /**
50859
50859
  * Get status updates for a fine-tuning job.
@@ -50869,7 +50869,7 @@ var init_jobs = __esmMin((() => {
50869
50869
  * ```
50870
50870
  */
50871
50871
  listEvents(fineTuningJobID, query = {}, options) {
50872
- return this._client.getAPIList(path$15`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, {
50872
+ return this._client.getAPIList(path$16`/fine_tuning/jobs/${fineTuningJobID}/events`, CursorPage, {
50873
50873
  query,
50874
50874
  ...options
50875
50875
  });
@@ -50885,7 +50885,7 @@ var init_jobs = __esmMin((() => {
50885
50885
  * ```
50886
50886
  */
50887
50887
  pause(fineTuningJobID, options) {
50888
- return this._client.post(path$15`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
50888
+ return this._client.post(path$16`/fine_tuning/jobs/${fineTuningJobID}/pause`, options);
50889
50889
  }
50890
50890
  /**
50891
50891
  * Resume a fine-tune job.
@@ -50898,7 +50898,7 @@ var init_jobs = __esmMin((() => {
50898
50898
  * ```
50899
50899
  */
50900
50900
  resume(fineTuningJobID, options) {
50901
- return this._client.post(path$15`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
50901
+ return this._client.post(path$16`/fine_tuning/jobs/${fineTuningJobID}/resume`, options);
50902
50902
  }
50903
50903
  };
50904
50904
  Jobs.Checkpoints = Checkpoints;
@@ -50999,7 +50999,7 @@ var init_models = __esmMin((() => {
50999
50999
  * the owner and permissioning.
51000
51000
  */
51001
51001
  retrieve(model, options) {
51002
- return this._client.get(path$15`/models/${model}`, options);
51002
+ return this._client.get(path$16`/models/${model}`, options);
51003
51003
  }
51004
51004
  /**
51005
51005
  * Lists the currently available models, and provides basic information about each
@@ -51013,7 +51013,7 @@ var init_models = __esmMin((() => {
51013
51013
  * delete a model.
51014
51014
  */
51015
51015
  delete(model, options) {
51016
- return this._client.delete(path$15`/models/${model}`, options);
51016
+ return this._client.delete(path$16`/models/${model}`, options);
51017
51017
  }
51018
51018
  };
51019
51019
  }));
@@ -51055,7 +51055,7 @@ var init_calls = __esmMin((() => {
51055
51055
  * ```
51056
51056
  */
51057
51057
  accept(callID, body, options) {
51058
- return this._client.post(path$15`/realtime/calls/${callID}/accept`, {
51058
+ return this._client.post(path$16`/realtime/calls/${callID}/accept`, {
51059
51059
  body,
51060
51060
  ...options,
51061
51061
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
@@ -51070,7 +51070,7 @@ var init_calls = __esmMin((() => {
51070
51070
  * ```
51071
51071
  */
51072
51072
  hangup(callID, options) {
51073
- return this._client.post(path$15`/realtime/calls/${callID}/hangup`, {
51073
+ return this._client.post(path$16`/realtime/calls/${callID}/hangup`, {
51074
51074
  ...options,
51075
51075
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
51076
51076
  });
@@ -51086,7 +51086,7 @@ var init_calls = __esmMin((() => {
51086
51086
  * ```
51087
51087
  */
51088
51088
  refer(callID, body, options) {
51089
- return this._client.post(path$15`/realtime/calls/${callID}/refer`, {
51089
+ return this._client.post(path$16`/realtime/calls/${callID}/refer`, {
51090
51090
  body,
51091
51091
  ...options,
51092
51092
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
@@ -51101,7 +51101,7 @@ var init_calls = __esmMin((() => {
51101
51101
  * ```
51102
51102
  */
51103
51103
  reject(callID, body = {}, options) {
51104
- return this._client.post(path$15`/realtime/calls/${callID}/reject`, {
51104
+ return this._client.post(path$16`/realtime/calls/${callID}/reject`, {
51105
51105
  body,
51106
51106
  ...options,
51107
51107
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
@@ -51507,7 +51507,7 @@ var init_input_items = __esmMin((() => {
51507
51507
  * ```
51508
51508
  */
51509
51509
  list(responseID, query = {}, options) {
51510
- return this._client.getAPIList(path$15`/responses/${responseID}/input_items`, CursorPage, {
51510
+ return this._client.getAPIList(path$16`/responses/${responseID}/input_items`, CursorPage, {
51511
51511
  query,
51512
51512
  ...options
51513
51513
  });
@@ -51567,7 +51567,7 @@ var init_responses = __esmMin((() => {
51567
51567
  });
51568
51568
  }
51569
51569
  retrieve(responseID, query = {}, options) {
51570
- return this._client.get(path$15`/responses/${responseID}`, {
51570
+ return this._client.get(path$16`/responses/${responseID}`, {
51571
51571
  query,
51572
51572
  ...options,
51573
51573
  stream: query?.stream ?? false
@@ -51587,7 +51587,7 @@ var init_responses = __esmMin((() => {
51587
51587
  * ```
51588
51588
  */
51589
51589
  delete(responseID, options) {
51590
- return this._client.delete(path$15`/responses/${responseID}`, {
51590
+ return this._client.delete(path$16`/responses/${responseID}`, {
51591
51591
  ...options,
51592
51592
  headers: buildHeaders([{ Accept: "*/*" }, options?.headers])
51593
51593
  });
@@ -51614,7 +51614,7 @@ var init_responses = __esmMin((() => {
51614
51614
  * ```
51615
51615
  */
51616
51616
  cancel(responseID, options) {
51617
- return this._client.post(path$15`/responses/${responseID}/cancel`, options);
51617
+ return this._client.post(path$16`/responses/${responseID}/cancel`, options);
51618
51618
  }
51619
51619
  /**
51620
51620
  * Compact a conversation. Returns a compacted response object.
@@ -51653,7 +51653,7 @@ var init_content$1 = __esmMin((() => {
51653
51653
  * Download a skill zip bundle by its ID.
51654
51654
  */
51655
51655
  retrieve(skillID, options) {
51656
- return this._client.get(path$15`/skills/${skillID}/content`, {
51656
+ return this._client.get(path$16`/skills/${skillID}/content`, {
51657
51657
  ...options,
51658
51658
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
51659
51659
  __binaryResponse: true
@@ -51674,7 +51674,7 @@ var init_content = __esmMin((() => {
51674
51674
  */
51675
51675
  retrieve(version, params, options) {
51676
51676
  const { skill_id } = params;
51677
- return this._client.get(path$15`/skills/${skill_id}/versions/${version}/content`, {
51677
+ return this._client.get(path$16`/skills/${skill_id}/versions/${version}/content`, {
51678
51678
  ...options,
51679
51679
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
51680
51680
  __binaryResponse: true
@@ -51700,7 +51700,7 @@ var init_versions$1 = __esmMin((() => {
51700
51700
  * Create a new immutable skill version.
51701
51701
  */
51702
51702
  create(skillID, body = {}, options) {
51703
- return this._client.post(path$15`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({
51703
+ return this._client.post(path$16`/skills/${skillID}/versions`, maybeMultipartFormRequestOptions({
51704
51704
  body,
51705
51705
  ...options
51706
51706
  }, this._client));
@@ -51710,13 +51710,13 @@ var init_versions$1 = __esmMin((() => {
51710
51710
  */
51711
51711
  retrieve(version, params, options) {
51712
51712
  const { skill_id } = params;
51713
- return this._client.get(path$15`/skills/${skill_id}/versions/${version}`, options);
51713
+ return this._client.get(path$16`/skills/${skill_id}/versions/${version}`, options);
51714
51714
  }
51715
51715
  /**
51716
51716
  * List skill versions for a skill.
51717
51717
  */
51718
51718
  list(skillID, query = {}, options) {
51719
- return this._client.getAPIList(path$15`/skills/${skillID}/versions`, CursorPage, {
51719
+ return this._client.getAPIList(path$16`/skills/${skillID}/versions`, CursorPage, {
51720
51720
  query,
51721
51721
  ...options
51722
51722
  });
@@ -51726,7 +51726,7 @@ var init_versions$1 = __esmMin((() => {
51726
51726
  */
51727
51727
  delete(version, params, options) {
51728
51728
  const { skill_id } = params;
51729
- return this._client.delete(path$15`/skills/${skill_id}/versions/${version}`, options);
51729
+ return this._client.delete(path$16`/skills/${skill_id}/versions/${version}`, options);
51730
51730
  }
51731
51731
  };
51732
51732
  Versions.Content = Content;
@@ -51760,13 +51760,13 @@ var init_skills = __esmMin((() => {
51760
51760
  * Get a skill by its ID.
51761
51761
  */
51762
51762
  retrieve(skillID, options) {
51763
- return this._client.get(path$15`/skills/${skillID}`, options);
51763
+ return this._client.get(path$16`/skills/${skillID}`, options);
51764
51764
  }
51765
51765
  /**
51766
51766
  * Update the default version pointer for a skill.
51767
51767
  */
51768
51768
  update(skillID, body, options) {
51769
- return this._client.post(path$15`/skills/${skillID}`, {
51769
+ return this._client.post(path$16`/skills/${skillID}`, {
51770
51770
  body,
51771
51771
  ...options
51772
51772
  });
@@ -51784,7 +51784,7 @@ var init_skills = __esmMin((() => {
51784
51784
  * Delete a skill by its ID.
51785
51785
  */
51786
51786
  delete(skillID, options) {
51787
- return this._client.delete(path$15`/skills/${skillID}`, options);
51787
+ return this._client.delete(path$16`/skills/${skillID}`, options);
51788
51788
  }
51789
51789
  };
51790
51790
  Skills.Content = Content$1;
@@ -51812,7 +51812,7 @@ var init_parts = __esmMin((() => {
51812
51812
  * [complete the Upload](https://platform.openai.com/docs/api-reference/uploads/complete).
51813
51813
  */
51814
51814
  create(uploadID, body, options) {
51815
- return this._client.post(path$15`/uploads/${uploadID}/parts`, multipartFormRequestOptions({
51815
+ return this._client.post(path$16`/uploads/${uploadID}/parts`, multipartFormRequestOptions({
51816
51816
  body,
51817
51817
  ...options
51818
51818
  }, this._client));
@@ -51866,7 +51866,7 @@ var init_uploads = __esmMin((() => {
51866
51866
  * Returns the Upload object with status `cancelled`.
51867
51867
  */
51868
51868
  cancel(uploadID, options) {
51869
- return this._client.post(path$15`/uploads/${uploadID}/cancel`, options);
51869
+ return this._client.post(path$16`/uploads/${uploadID}/cancel`, options);
51870
51870
  }
51871
51871
  /**
51872
51872
  * Completes the
@@ -51886,7 +51886,7 @@ var init_uploads = __esmMin((() => {
51886
51886
  * object.
51887
51887
  */
51888
51888
  complete(uploadID, body, options) {
51889
- return this._client.post(path$15`/uploads/${uploadID}/complete`, {
51889
+ return this._client.post(path$16`/uploads/${uploadID}/complete`, {
51890
51890
  body,
51891
51891
  ...options
51892
51892
  });
@@ -51925,7 +51925,7 @@ var init_file_batches = __esmMin((() => {
51925
51925
  * Create a vector store file batch.
51926
51926
  */
51927
51927
  create(vectorStoreID, body, options) {
51928
- return this._client.post(path$15`/vector_stores/${vectorStoreID}/file_batches`, {
51928
+ return this._client.post(path$16`/vector_stores/${vectorStoreID}/file_batches`, {
51929
51929
  body,
51930
51930
  ...options,
51931
51931
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -51936,7 +51936,7 @@ var init_file_batches = __esmMin((() => {
51936
51936
  */
51937
51937
  retrieve(batchID, params, options) {
51938
51938
  const { vector_store_id } = params;
51939
- return this._client.get(path$15`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
51939
+ return this._client.get(path$16`/vector_stores/${vector_store_id}/file_batches/${batchID}`, {
51940
51940
  ...options,
51941
51941
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
51942
51942
  });
@@ -51947,7 +51947,7 @@ var init_file_batches = __esmMin((() => {
51947
51947
  */
51948
51948
  cancel(batchID, params, options) {
51949
51949
  const { vector_store_id } = params;
51950
- return this._client.post(path$15`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
51950
+ return this._client.post(path$16`/vector_stores/${vector_store_id}/file_batches/${batchID}/cancel`, {
51951
51951
  ...options,
51952
51952
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
51953
51953
  });
@@ -51964,7 +51964,7 @@ var init_file_batches = __esmMin((() => {
51964
51964
  */
51965
51965
  listFiles(batchID, params, options) {
51966
51966
  const { vector_store_id, ...query } = params;
51967
- return this._client.getAPIList(path$15`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, {
51967
+ return this._client.getAPIList(path$16`/vector_stores/${vector_store_id}/file_batches/${batchID}/files`, CursorPage, {
51968
51968
  query,
51969
51969
  ...options,
51970
51970
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -52047,7 +52047,7 @@ var init_files = __esmMin((() => {
52047
52047
  * [vector store](https://platform.openai.com/docs/api-reference/vector-stores/object).
52048
52048
  */
52049
52049
  create(vectorStoreID, body, options) {
52050
- return this._client.post(path$15`/vector_stores/${vectorStoreID}/files`, {
52050
+ return this._client.post(path$16`/vector_stores/${vectorStoreID}/files`, {
52051
52051
  body,
52052
52052
  ...options,
52053
52053
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -52058,7 +52058,7 @@ var init_files = __esmMin((() => {
52058
52058
  */
52059
52059
  retrieve(fileID, params, options) {
52060
52060
  const { vector_store_id } = params;
52061
- return this._client.get(path$15`/vector_stores/${vector_store_id}/files/${fileID}`, {
52061
+ return this._client.get(path$16`/vector_stores/${vector_store_id}/files/${fileID}`, {
52062
52062
  ...options,
52063
52063
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
52064
52064
  });
@@ -52068,7 +52068,7 @@ var init_files = __esmMin((() => {
52068
52068
  */
52069
52069
  update(fileID, params, options) {
52070
52070
  const { vector_store_id, ...body } = params;
52071
- return this._client.post(path$15`/vector_stores/${vector_store_id}/files/${fileID}`, {
52071
+ return this._client.post(path$16`/vector_stores/${vector_store_id}/files/${fileID}`, {
52072
52072
  body,
52073
52073
  ...options,
52074
52074
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -52078,7 +52078,7 @@ var init_files = __esmMin((() => {
52078
52078
  * Returns a list of vector store files.
52079
52079
  */
52080
52080
  list(vectorStoreID, query = {}, options) {
52081
- return this._client.getAPIList(path$15`/vector_stores/${vectorStoreID}/files`, CursorPage, {
52081
+ return this._client.getAPIList(path$16`/vector_stores/${vectorStoreID}/files`, CursorPage, {
52082
52082
  query,
52083
52083
  ...options,
52084
52084
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -52092,7 +52092,7 @@ var init_files = __esmMin((() => {
52092
52092
  */
52093
52093
  delete(fileID, params, options) {
52094
52094
  const { vector_store_id } = params;
52095
- return this._client.delete(path$15`/vector_stores/${vector_store_id}/files/${fileID}`, {
52095
+ return this._client.delete(path$16`/vector_stores/${vector_store_id}/files/${fileID}`, {
52096
52096
  ...options,
52097
52097
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
52098
52098
  });
@@ -52164,7 +52164,7 @@ var init_files = __esmMin((() => {
52164
52164
  */
52165
52165
  content(fileID, params, options) {
52166
52166
  const { vector_store_id } = params;
52167
- return this._client.getAPIList(path$15`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, {
52167
+ return this._client.getAPIList(path$16`/vector_stores/${vector_store_id}/files/${fileID}/content`, Page, {
52168
52168
  ...options,
52169
52169
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
52170
52170
  });
@@ -52201,7 +52201,7 @@ var init_vector_stores = __esmMin((() => {
52201
52201
  * Retrieves a vector store.
52202
52202
  */
52203
52203
  retrieve(vectorStoreID, options) {
52204
- return this._client.get(path$15`/vector_stores/${vectorStoreID}`, {
52204
+ return this._client.get(path$16`/vector_stores/${vectorStoreID}`, {
52205
52205
  ...options,
52206
52206
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
52207
52207
  });
@@ -52210,7 +52210,7 @@ var init_vector_stores = __esmMin((() => {
52210
52210
  * Modifies a vector store.
52211
52211
  */
52212
52212
  update(vectorStoreID, body, options) {
52213
- return this._client.post(path$15`/vector_stores/${vectorStoreID}`, {
52213
+ return this._client.post(path$16`/vector_stores/${vectorStoreID}`, {
52214
52214
  body,
52215
52215
  ...options,
52216
52216
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
@@ -52230,7 +52230,7 @@ var init_vector_stores = __esmMin((() => {
52230
52230
  * Delete a vector store.
52231
52231
  */
52232
52232
  delete(vectorStoreID, options) {
52233
- return this._client.delete(path$15`/vector_stores/${vectorStoreID}`, {
52233
+ return this._client.delete(path$16`/vector_stores/${vectorStoreID}`, {
52234
52234
  ...options,
52235
52235
  headers: buildHeaders([{ "OpenAI-Beta": "assistants=v2" }, options?.headers])
52236
52236
  });
@@ -52240,7 +52240,7 @@ var init_vector_stores = __esmMin((() => {
52240
52240
  * filter.
52241
52241
  */
52242
52242
  search(vectorStoreID, body, options) {
52243
- return this._client.getAPIList(path$15`/vector_stores/${vectorStoreID}/search`, Page, {
52243
+ return this._client.getAPIList(path$16`/vector_stores/${vectorStoreID}/search`, Page, {
52244
52244
  body,
52245
52245
  method: "post",
52246
52246
  ...options,
@@ -52274,7 +52274,7 @@ var init_videos = __esmMin((() => {
52274
52274
  * Fetch the latest metadata for a generated video.
52275
52275
  */
52276
52276
  retrieve(videoID, options) {
52277
- return this._client.get(path$15`/videos/${videoID}`, options);
52277
+ return this._client.get(path$16`/videos/${videoID}`, options);
52278
52278
  }
52279
52279
  /**
52280
52280
  * List recently generated videos for the current project.
@@ -52289,7 +52289,7 @@ var init_videos = __esmMin((() => {
52289
52289
  * Permanently delete a completed or failed video and its stored assets.
52290
52290
  */
52291
52291
  delete(videoID, options) {
52292
- return this._client.delete(path$15`/videos/${videoID}`, options);
52292
+ return this._client.delete(path$16`/videos/${videoID}`, options);
52293
52293
  }
52294
52294
  /**
52295
52295
  * Create a character from an uploaded video.
@@ -52306,7 +52306,7 @@ var init_videos = __esmMin((() => {
52306
52306
  * Streams the rendered video content for the specified video job.
52307
52307
  */
52308
52308
  downloadContent(videoID, query = {}, options) {
52309
- return this._client.get(path$15`/videos/${videoID}/content`, {
52309
+ return this._client.get(path$16`/videos/${videoID}/content`, {
52310
52310
  query,
52311
52311
  ...options,
52312
52312
  headers: buildHeaders([{ Accept: "application/binary" }, options?.headers]),
@@ -52336,13 +52336,13 @@ var init_videos = __esmMin((() => {
52336
52336
  * Fetch a character.
52337
52337
  */
52338
52338
  getCharacter(characterID, options) {
52339
- return this._client.get(path$15`/videos/characters/${characterID}`, options);
52339
+ return this._client.get(path$16`/videos/characters/${characterID}`, options);
52340
52340
  }
52341
52341
  /**
52342
52342
  * Create a remix of a completed video using a refreshed prompt.
52343
52343
  */
52344
52344
  remix(videoID, body, options) {
52345
- return this._client.post(path$15`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({
52345
+ return this._client.post(path$16`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({
52346
52346
  body,
52347
52347
  ...options
52348
52348
  }, this._client));
@@ -53297,11 +53297,11 @@ var init_kimi_files = __esmMin((() => {
53297
53297
  async uploadVideo(input, options) {
53298
53298
  let file;
53299
53299
  if (typeof input === "string") {
53300
- if (!fs$15.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
53301
- const filename = path$14.basename(input);
53300
+ if (!fs$16.existsSync(input)) throw new ChatProviderError(`Video file not found: ${input}`);
53301
+ const filename = path$15.basename(input);
53302
53302
  const mimeType = guessMimeTypeFromExt(filename);
53303
53303
  if (mimeType === void 0 || !mimeType.startsWith("video/")) throw new ChatProviderError(`KimiFiles.uploadVideo: file extension does not indicate a video type: ${filename}`);
53304
- const data = await fs$15.promises.readFile(input);
53304
+ const data = await fs$16.promises.readFile(input);
53305
53305
  file = new File$1([new Blob$1([new Uint8Array(data)], { type: mimeType })], filename, { type: mimeType });
53306
53306
  } else {
53307
53307
  if (!input.mimeType.startsWith("video/")) throw new ChatProviderError(`Expected a video mime type, got ${input.mimeType}`);
@@ -62323,7 +62323,7 @@ async function syncDir(dirPath) {
62323
62323
  */
62324
62324
  function syncFd(fd) {
62325
62325
  return new Promise((resolve, reject) => {
62326
- fs$15.fsync(fd, (err) => {
62326
+ fs$16.fsync(fd, (err) => {
62327
62327
  if (err) {
62328
62328
  reject(err);
62329
62329
  return;
@@ -72273,7 +72273,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72273
72273
  };
72274
72274
  return _setPrototypeOf(o, p);
72275
72275
  }
72276
- var path$13 = __require("path");
72276
+ var path$14 = __require("path");
72277
72277
  module.exports = /* @__PURE__ */ function(_EmitterObj) {
72278
72278
  _inheritsLoose(Loader, _EmitterObj);
72279
72279
  function Loader() {
@@ -72281,7 +72281,7 @@ var require_loader = /* @__PURE__ */ __commonJSMin(((exports, module) => {
72281
72281
  }
72282
72282
  var _proto = Loader.prototype;
72283
72283
  _proto.resolve = function resolve(from, to) {
72284
- return path$13.resolve(path$13.dirname(from), to);
72284
+ return path$14.resolve(path$14.dirname(from), to);
72285
72285
  };
72286
72286
  _proto.isRelative = function isRelative(filename) {
72287
72287
  return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
@@ -73937,8 +73937,8 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73937
73937
  };
73938
73938
  return _setPrototypeOf(o, p);
73939
73939
  }
73940
- var fs$14 = __require("fs");
73941
- var path$12 = __require("path");
73940
+ var fs$15 = __require("fs");
73941
+ var path$13 = __require("path");
73942
73942
  var Loader = require_loader();
73943
73943
  var PrecompiledLoader = require_precompiled_loader().PrecompiledLoader;
73944
73944
  var chokidar;
@@ -73953,7 +73953,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73953
73953
  _this.noCache = !!opts.noCache;
73954
73954
  if (searchPaths) {
73955
73955
  searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
73956
- _this.searchPaths = searchPaths.map(path$12.normalize);
73956
+ _this.searchPaths = searchPaths.map(path$13.normalize);
73957
73957
  } else _this.searchPaths = ["."];
73958
73958
  if (opts.watch) {
73959
73959
  try {
@@ -73961,10 +73961,10 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73961
73961
  } catch (e) {
73962
73962
  throw new Error("watch requires chokidar to be installed");
73963
73963
  }
73964
- var paths = _this.searchPaths.filter(fs$14.existsSync);
73964
+ var paths = _this.searchPaths.filter(fs$15.existsSync);
73965
73965
  var watcher = chokidar.watch(paths);
73966
73966
  watcher.on("all", function(event, fullname) {
73967
- fullname = path$12.resolve(fullname);
73967
+ fullname = path$13.resolve(fullname);
73968
73968
  if (event === "change" && fullname in _this.pathsToNames) _this.emit("update", _this.pathsToNames[fullname], fullname);
73969
73969
  });
73970
73970
  watcher.on("error", function(error) {
@@ -73978,9 +73978,9 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73978
73978
  var fullpath = null;
73979
73979
  var paths = this.searchPaths;
73980
73980
  for (var i = 0; i < paths.length; i++) {
73981
- var basePath = path$12.resolve(paths[i]);
73982
- var p = path$12.resolve(paths[i], name);
73983
- if (p.indexOf(basePath) === 0 && fs$14.existsSync(p)) {
73981
+ var basePath = path$13.resolve(paths[i]);
73982
+ var p = path$13.resolve(paths[i], name);
73983
+ if (p.indexOf(basePath) === 0 && fs$15.existsSync(p)) {
73984
73984
  fullpath = p;
73985
73985
  break;
73986
73986
  }
@@ -73988,7 +73988,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
73988
73988
  if (!fullpath) return null;
73989
73989
  this.pathsToNames[fullpath] = name;
73990
73990
  var source = {
73991
- src: fs$14.readFileSync(fullpath, "utf-8"),
73991
+ src: fs$15.readFileSync(fullpath, "utf-8"),
73992
73992
  path: fullpath,
73993
73993
  noCache: this.noCache
73994
73994
  };
@@ -74036,7 +74036,7 @@ var require_node_loaders = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74036
74036
  }
74037
74037
  this.pathsToNames[fullpath] = name;
74038
74038
  var source = {
74039
- src: fs$14.readFileSync(fullpath, "utf-8"),
74039
+ src: fs$15.readFileSync(fullpath, "utf-8"),
74040
74040
  path: fullpath,
74041
74041
  noCache: this.noCache
74042
74042
  };
@@ -74338,13 +74338,13 @@ var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74338
74338
  //#endregion
74339
74339
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/express-app.js
74340
74340
  var require_express_app = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74341
- var path$11 = __require("path");
74341
+ var path$12 = __require("path");
74342
74342
  module.exports = function express(env, app) {
74343
74343
  function NunjucksView(name, opts) {
74344
74344
  this.name = name;
74345
74345
  this.path = name;
74346
74346
  this.defaultEngine = opts.defaultEngine;
74347
- this.ext = path$11.extname(name);
74347
+ this.ext = path$12.extname(name);
74348
74348
  if (!this.ext && !this.defaultEngine) throw new Error("No default engine was specified and no extension was provided.");
74349
74349
  if (!this.ext) this.name += this.ext = (this.defaultEngine[0] !== "." ? "." : "") + this.defaultEngine;
74350
74350
  }
@@ -74780,8 +74780,8 @@ var require_precompile_global = /* @__PURE__ */ __commonJSMin(((exports, module)
74780
74780
  //#endregion
74781
74781
  //#region ../../node_modules/.pnpm/nunjucks@3.2.4_chokidar@4.0.3/node_modules/nunjucks/src/precompile.js
74782
74782
  var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74783
- var fs$13 = __require("fs");
74784
- var path$10 = __require("path");
74783
+ var fs$14 = __require("fs");
74784
+ var path$11 = __require("path");
74785
74785
  var _prettifyError = require_lib$7()._prettifyError;
74786
74786
  var compiler = require_compiler();
74787
74787
  var Environment = require_environment().Environment;
@@ -74805,27 +74805,27 @@ var require_precompile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
74805
74805
  var env = opts.env || new Environment([]);
74806
74806
  var wrapper = opts.wrapper || precompileGlobal;
74807
74807
  if (opts.isString) return precompileString(input, opts);
74808
- var pathStats = fs$13.existsSync(input) && fs$13.statSync(input);
74808
+ var pathStats = fs$14.existsSync(input) && fs$14.statSync(input);
74809
74809
  var precompiled = [];
74810
74810
  var templates = [];
74811
74811
  function addTemplates(dir) {
74812
- fs$13.readdirSync(dir).forEach(function(file) {
74813
- var filepath = path$10.join(dir, file);
74814
- var subpath = filepath.substr(path$10.join(input, "/").length);
74815
- var stat = fs$13.statSync(filepath);
74812
+ fs$14.readdirSync(dir).forEach(function(file) {
74813
+ var filepath = path$11.join(dir, file);
74814
+ var subpath = filepath.substr(path$11.join(input, "/").length);
74815
+ var stat = fs$14.statSync(filepath);
74816
74816
  if (stat && stat.isDirectory()) {
74817
74817
  subpath += "/";
74818
74818
  if (!match(subpath, opts.exclude)) addTemplates(filepath);
74819
74819
  } else if (match(subpath, opts.include)) templates.push(filepath);
74820
74820
  });
74821
74821
  }
74822
- if (pathStats.isFile()) precompiled.push(_precompile(fs$13.readFileSync(input, "utf-8"), opts.name || input, env));
74822
+ if (pathStats.isFile()) precompiled.push(_precompile(fs$14.readFileSync(input, "utf-8"), opts.name || input, env));
74823
74823
  else if (pathStats.isDirectory()) {
74824
74824
  addTemplates(input);
74825
74825
  for (var i = 0; i < templates.length; i++) {
74826
- var name = templates[i].replace(path$10.join(input, "/"), "");
74826
+ var name = templates[i].replace(path$11.join(input, "/"), "");
74827
74827
  try {
74828
- precompiled.push(_precompile(fs$13.readFileSync(templates[i], "utf-8"), name, env));
74828
+ precompiled.push(_precompile(fs$14.readFileSync(templates[i], "utf-8"), name, env));
74829
74829
  } catch (e) {
74830
74830
  if (opts.force) console.error(e);
74831
74831
  else throw e;
@@ -76134,9 +76134,9 @@ var init_question_task = __esmMin((() => {
76134
76134
  function isBackgroundTaskTerminal(status) {
76135
76135
  return TERMINAL_STATUSES.has(status);
76136
76136
  }
76137
- /** Terminal `stopReason` recorded when a foreground command trips the output ceiling. */
76138
- function foregroundOutputLimitReason() {
76139
- return `Output limit exceeded: the command produced more than ${Math.floor(MAX_FOREGROUND_OUTPUT_BYTES / (1024 * 1024))} MiB and was terminated. Redirect large output to a file (e.g. \`command > out.txt\`) and inspect it in slices instead.`;
76137
+ /** Terminal `stopReason` recorded when a command trips the output ceiling. */
76138
+ function outputLimitReason() {
76139
+ return `Output limit exceeded: the command produced more than ${Math.floor(MAX_TASK_OUTPUT_BYTES / (1024 * 1024))} MiB and was terminated. Redirect large output to a file (e.g. \`command > out.txt\`) and inspect it in slices instead.`;
76140
76140
  }
76141
76141
  /**
76142
76142
  * Generate `{prefix}-{8 base36 chars}`.
@@ -76197,7 +76197,13 @@ function buildBackgroundTaskNotificationBody(info) {
76197
76197
  "The subagent retains its full prior context across the restart, but any in-flight tool call lost its result and may need to be redone."
76198
76198
  ].join("\n")}`;
76199
76199
  }
76200
- var MAX_OUTPUT_BYTES$1, NOTIFICATION_FALLBACK_PREVIEW_BYTES, MAX_FOREGROUND_OUTPUT_BYTES, SIGTERM_GRACE_MS$1, USER_INTERRUPT_REASON$1, _ALPHABET, BackgroundManager;
76200
+ function abortRejecter(signal) {
76201
+ if (signal.aborted) return Promise.reject(signal.reason ?? /* @__PURE__ */ new Error("Aborted"));
76202
+ return new Promise((_, reject) => {
76203
+ signal.addEventListener("abort", () => reject(signal.reason ?? /* @__PURE__ */ new Error("Aborted")), { once: true });
76204
+ });
76205
+ }
76206
+ var MAX_OUTPUT_BYTES$1, NOTIFICATION_FALLBACK_PREVIEW_BYTES, MAX_TASK_OUTPUT_BYTES, SIGTERM_GRACE_MS$1, USER_INTERRUPT_REASON$1, _ALPHABET, BackgroundManager;
76201
76207
  var init_background = __esmMin((() => {
76202
76208
  init_dist$4();
76203
76209
  init_errors$5();
@@ -76211,7 +76217,7 @@ var init_background = __esmMin((() => {
76211
76217
  init_persist$1();
76212
76218
  MAX_OUTPUT_BYTES$1 = 1024 * 1024;
76213
76219
  NOTIFICATION_FALLBACK_PREVIEW_BYTES = 3e3;
76214
- MAX_FOREGROUND_OUTPUT_BYTES = 16 * 1024 * 1024;
76220
+ MAX_TASK_OUTPUT_BYTES = 16 * 1024 * 1024;
76215
76221
  SIGTERM_GRACE_MS$1 = 5e3;
76216
76222
  USER_INTERRUPT_REASON$1 = "Interrupted by user";
76217
76223
  _ALPHABET = "0123456789abcdefghijklmnopqrstuvwxyz";
@@ -76457,6 +76463,34 @@ var init_background = __esmMin((() => {
76457
76463
  return this.toInfo(entry);
76458
76464
  }
76459
76465
  /**
76466
+ * Wait until no active (non-terminal) task matching `predicate` remains.
76467
+ *
76468
+ * Used by print-mode (`kimi -p`) turn draining to hold a turn open while
76469
+ * background subagents are still running. Re-enumerates after each batch
76470
+ * settles so tasks registered during the wait (fan-out) are picked up.
76471
+ * Resolves immediately when nothing matches. Bounded by `timeoutMs`; once
76472
+ * the deadline passes the method returns without waiting for stragglers.
76473
+ * Rejects with the abort reason when `signal` is aborted.
76474
+ */
76475
+ async waitForActiveTasks(predicate, options = {}) {
76476
+ const deadline = options.timeoutMs !== void 0 && options.timeoutMs > 0 ? Date.now() + options.timeoutMs : void 0;
76477
+ const signal = options.signal;
76478
+ while (true) {
76479
+ signal?.throwIfAborted();
76480
+ const active = this.list(true).filter(predicate);
76481
+ if (active.length === 0) return;
76482
+ let perTaskTimeout;
76483
+ if (deadline !== void 0) {
76484
+ const remaining = deadline - Date.now();
76485
+ if (remaining <= 0) return;
76486
+ perTaskTimeout = remaining;
76487
+ }
76488
+ const batch = Promise.all(active.map((t) => this.wait(t.taskId, perTaskTimeout)));
76489
+ if (signal === void 0) await batch;
76490
+ else await Promise.race([batch, abortRejecter(signal)]);
76491
+ }
76492
+ }
76493
+ /**
76460
76494
  * Wait until a foreground task either detaches from the current tool call or
76461
76495
  * reaches a terminal state. Detached tasks return immediately.
76462
76496
  */
@@ -76535,9 +76569,9 @@ var init_background = __esmMin((() => {
76535
76569
  if (removed === void 0) break;
76536
76570
  entry.outputRingChars -= removed.length;
76537
76571
  }
76538
- if (!entry.outputLimitTripped && !this.isDetached(entry) && entry.outputSizeBytes > MAX_FOREGROUND_OUTPUT_BYTES) {
76572
+ if (!entry.outputLimitTripped && entry.task.kind === "process" && entry.outputSizeBytes > MAX_TASK_OUTPUT_BYTES) {
76539
76573
  entry.outputLimitTripped = true;
76540
- this.stop(entry.taskId, foregroundOutputLimitReason());
76574
+ this.stop(entry.taskId, outputLimitReason());
76541
76575
  }
76542
76576
  if (entry.outputLimitTripped) return;
76543
76577
  if (this.persistence === void 0) return;
@@ -85219,7 +85253,7 @@ var require_gifframe = /* @__PURE__ */ __commonJSMin(((exports) => {
85219
85253
  //#region ../../node_modules/.pnpm/gifwrap@0.10.1/node_modules/gifwrap/src/gifutil.js
85220
85254
  var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
85221
85255
  /** @namespace GifUtil */
85222
- const fs$12 = __require("fs");
85256
+ const fs$13 = __require("fs");
85223
85257
  const ImageQ = require_image_q();
85224
85258
  const BitmapImage = require_bitmapimage();
85225
85259
  const { GifFrame } = require_gifframe();
@@ -85486,7 +85520,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
85486
85520
  }
85487
85521
  function _readBinary(path) {
85488
85522
  return new Promise((resolve, reject) => {
85489
- fs$12.readFile(path, (err, buffer) => {
85523
+ fs$13.readFile(path, (err, buffer) => {
85490
85524
  if (err) return reject(err);
85491
85525
  return resolve(buffer);
85492
85526
  });
@@ -85494,7 +85528,7 @@ var require_gifutil = /* @__PURE__ */ __commonJSMin(((exports) => {
85494
85528
  }
85495
85529
  function _writeBinary(path, buffer) {
85496
85530
  return new Promise((resolve, reject) => {
85497
- fs$12.writeFile(path, buffer, (err) => {
85531
+ fs$13.writeFile(path, buffer, (err) => {
85498
85532
  if (err) return reject(err);
85499
85533
  return resolve();
85500
85534
  });
@@ -110488,7 +110522,7 @@ var init_file_type = __esmMin((() => {
110488
110522
  }
110489
110523
  async fromFile(path) {
110490
110524
  this.options.signal?.throwIfAborted();
110491
- const fileHandle = await jn.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
110525
+ const fileHandle = await fs.open(path, constants.O_RDONLY | constants.O_NONBLOCK);
110492
110526
  const fileStat = await fileHandle.stat();
110493
110527
  if (!fileStat.isFile()) {
110494
110528
  await fileHandle.close();
@@ -120993,7 +121027,7 @@ async function processBitmapFont(file, font) {
120993
121027
  ...font,
120994
121028
  chars,
120995
121029
  kernings,
120996
- pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read($s.join($s.dirname(file), page))))
121030
+ pages: await Promise.all(font.pages.map(async (page) => CharacterJimp.read(path$1.join(path$1.dirname(file), page))))
120997
121031
  };
120998
121032
  }
120999
121033
  var import_parse_bmfont_ascii, import_lib$1, import_parse_bmfont_binary, convertXML, isWebWorker, CharacterJimp, HEADER;
@@ -137915,7 +137949,14 @@ var init_meta = __esmMin((() => {
137915
137949
  capabilities: metaCapabilitiesSchema,
137916
137950
  server_id: string().min(1),
137917
137951
  started_at: isoDateTimeSchema,
137918
- open_in_apps: array(fsOpenInAppIdSchema)
137952
+ open_in_apps: array(fsOpenInAppIdSchema),
137953
+ /**
137954
+ * True when the server was started with `--dangerous-bypass-auth`, meaning
137955
+ * the bearer-token gate is disabled on every REST and WebSocket route. The
137956
+ * web UI reads this to skip the token prompt and connect without a
137957
+ * credential. Defaults to false on hardened boots.
137958
+ */
137959
+ dangerous_bypass_auth: boolean$1()
137919
137960
  });
137920
137961
  }));
137921
137962
  //#endregion
@@ -144072,7 +144113,7 @@ function Pn(s, t) {
144072
144113
  function zn(s, t) {
144073
144114
  s.head = new ue$1(t, void 0, s.head, s), s.tail || (s.tail = s.head), s.length++;
144074
144115
  }
144075
- var kr, vr, Os, Br, Pr, zr, q$1, j$1, rt$1, Le$1, jt, Ne$1, Ts, Ae$1, xs, z$1, Mt, b$1, Qt, Bt, _$1, A$1, g$1, yi, De$1, L$1, w$1, Ri, bi, Ls, _i, Z$1, gi, Ie$1, Jt$1, yt, C, te, Ur, Hr, Wr, Gr, Ce$1, Oi, Zr, Yr, D$1, Vr, ot, H$1, ee$1, m$1, xi, J$1, Li, Ii, Ci, se$1, Fe$1, Ut$1, Ht, Ni, Pt, ht, U$1, nt$1, Y$1, zt, Ai, Q$1, ie$1, Di, ke$1, Rt, ve$1, bt, _t, Me, tt$1, Wt$1, $r, As, Ds, Is, Cs, Fs, Xr, re, K$1, jr, M$1, Qr, vs, Jr, ki, Ot, Gt, vi, ne, Be$1, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ms, en, sn, Bs, rn, nn, Ps, zs, Bi, oe$1, hn, he$1, Ke$1, F$1, an, Tt, Pi, ln, at, cn, fn, dn, lt, un, mn, pn, zi, En, xt, ct, Sn, yn, Rn, f, Yt$1, Lt, gn, Zi, Yi, On, B$1, Nt, et$1, Ui, Us, V$1, ae$1, ft, Hs, p, it, dt, Hi, At, y$1, Ve$1, $e$1, Wi, Ws, Gs, le$1, Gi, Xe$1, Kt$1, ut, qe$1, Dt, je$1, Qe$1, Zs, Tn, st$1, mt, Nn, Ki, An, Dn, It, Vi, Cn, Ys, ce$1, Je$1, $i, Fn, kn, Xi, Ks, Js, vn, Xs, qs, js, ji, Qs, fe$1, ti, Qi, ei, Ji, ts, es, is$2, pt, ii, ss, qi, X$1, de$1, si, ri, Mn, ni, ue$1, di, tr, oi, me$1, W$1, Ct, Ft$1, pe$2, rs, G, ns, hi, er, as, ls, ai, li, ir, os$5, ci, rr, hs, Et, kt, Un, Hn, or, hr, Wn, Gn, fr, dr, ar, ur, mr, pr, Kn, Vn, $n, lr, cs, fs$11, ui, Xn, ds, qn, us, we$1, wt, Qn, Er, ms, wr, Jn, Sr, ps, yr, $t, Rr, eo, io, Ei, _r, gr, ys, Or, Rs, P$1, bs, _s, Si, Tr, xr, ye$1, Lr, Nr, Es, St, O$1, wi, Ar, Xt$1, ws, Ss, gs, Re, be, _e$1, ge$1, Oe$1, no, oo, ho, Dr, qt, Se$1, Te$1, ao, lo, co, fo, uo, mo, po, Eo, vt, So;
144116
+ var kr, vr, Os, Br, Pr, zr, q$1, j$1, rt$1, Le$1, jt, Ne$1, Ts, Ae$1, xs, z$1, Mt, b$1, Qt, Bt, _$1, A$1, g$1, yi, De$1, L$1, w$1, Ri, bi, Ls, _i, Z$1, gi, Ie$1, Jt$1, yt, C, te, Ur, Hr, Wr, Gr, Ce$1, Oi, Zr, Yr, D$1, Vr, ot, H$1, ee$1, m$1, xi, J$1, Li, Ii, Ci, se$1, Fe$1, Ut$1, Ht, Ni, Pt, ht, U$1, nt$1, Y$1, zt, Ai, Q$1, ie$1, Di, ke$1, Rt, ve$1, bt, _t, Me, tt$1, Wt$1, $r, As, Ds, Is, Cs, Fs, Xr, re, K$1, jr, M$1, Qr, vs, Jr, ki, Ot, Gt, vi, ne, Be$1, Pe$1, ze$1, Ue, He$1, We$1, Ge$1, Ze$1, Ye$1, Ms, en, sn, Bs, rn, nn, Ps, zs, Bi, oe$1, hn, he$1, Ke$1, F$1, an, Tt, Pi, ln, at, cn, fn, dn, lt, un, mn, pn, zi, En, xt, ct, Sn, yn, Rn, f, Yt$1, Lt, gn, Zi, Yi, On, B$1, Nt, et$1, Ui, Us, V$1, ae$1, ft, Hs, p, it, dt, Hi, At, y$1, Ve$1, $e$1, Wi, Ws, Gs, le$1, Gi, Xe$1, Kt$1, ut, qe$1, Dt, je$1, Qe$1, Zs, Tn, st$1, mt, Nn, Ki, An, Dn, It, Vi, Cn, Ys, ce$1, Je$1, $i, Fn, kn, Xi, Ks, Js, vn, Xs, qs, js, ji, Qs, fe$1, ti, Qi, ei, Ji, ts, es, is$2, pt, ii, ss, qi, X$1, de$1, si, ri, Mn, ni, ue$1, di, tr, oi, me$1, W$1, Ct, Ft$1, pe$2, rs, G, ns, hi, er, as, ls, ai, li, ir, os$5, ci, rr, hs, Et, kt, Un, Hn, or, hr, Wn, Gn, fr, dr, ar, ur, mr, pr, Kn, Vn, $n, lr, cs, fs$12, ui, Xn, ds, qn, us, we$1, wt, Qn, Er, ms, wr, Jn, Sr, ps, yr, $t, Rr, eo, io, Ei, _r, gr, ys, Or, Rs, P$1, bs, _s, Si, Tr, xr, ye$1, Lr, Nr, Es, St, O$1, wi, Ar, Xt$1, ws, Ss, gs, Re, be, _e$1, ge$1, Oe$1, no, oo, ho, Dr, qt, Se$1, Te$1, ao, lo, co, fo, uo, mo, po, Eo, vt, So;
144076
144117
  var init_index_min = __esmMin((() => {
144077
144118
  kr = Object.defineProperty;
144078
144119
  vr = (s, t) => {
@@ -145542,7 +145583,7 @@ while (this[Us](this[it].shift()));
145542
145583
  let [o, h] = ce$1(this.path);
145543
145584
  o && typeof h == "string" && (this.path = h, r = o);
145544
145585
  }
145545
- this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || $s.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
145586
+ this.win32 = !!i.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t = t.replaceAll(/\\/g, "/")), this.absolute = f(i.absolute || path$1.resolve(this.cwd, t)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, {
145546
145587
  entry: this,
145547
145588
  path: r + this.path
145548
145589
  });
@@ -145625,7 +145666,7 @@ while (this[Us](this[it].shift()));
145625
145666
  }
145626
145667
  [Qs](t) {
145627
145668
  if (!this.stat) throw new Error("cannot create link entry without stat");
145628
- this.type = "Link", this.linkpath = f($s.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
145669
+ this.type = "Link", this.linkpath = f(path$1.relative(this.cwd, t)), this.stat.size = 0, this[fe$1](), this.end();
145629
145670
  }
145630
145671
  [qs]() {
145631
145672
  if (!this.stat) throw new Error("cannot create file entry without stat");
@@ -146033,7 +146074,7 @@ while (this[Us](this[it].shift()));
146033
146074
  return t instanceof Yt$1 ? this[er](t) : this[hi](t), this.flowing;
146034
146075
  }
146035
146076
  [er](t) {
146036
- let e = f($s.resolve(this.cwd, t.path));
146077
+ let e = f(path$1.resolve(this.cwd, t.path));
146037
146078
  if (!this.filter(t.path, t)) t.resume();
146038
146079
  else {
146039
146080
  let i = new di(t.path, e);
@@ -146042,7 +146083,7 @@ while (this[Us](this[it].shift()));
146042
146083
  this[Ft$1]();
146043
146084
  }
146044
146085
  [hi](t) {
146045
- let e = f($s.resolve(this.cwd, t));
146086
+ let e = f(path$1.resolve(this.cwd, t));
146046
146087
  this[W$1].push(new di(t, e)), this[Ft$1]();
146047
146088
  }
146048
146089
  [as](t) {
@@ -146215,7 +146256,7 @@ while (this[Us](this[it].shift()));
146215
146256
  if (!t?.length) throw new TypeError("no paths specified to add to archive");
146216
146257
  });
146217
146258
  fr = (process.env.__FAKE_PLATFORM__ || process.platform) === "win32", {O_CREAT: dr, O_NOFOLLOW: ar, O_TRUNC: ur, O_WRONLY: mr} = I.constants, pr = Number(process.env.__FAKE_FS_O_FILENAME__) || I.constants.UV_FS_O_FILEMAP || 0, Kn = fr && !!pr, Vn = 512 * 1024, $n = pr | ur | dr | mr, lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null, cs = lr !== null ? () => lr : Kn ? (s) => s < Vn ? $n : "w" : () => "w";
146218
- fs$11 = (s, t, e) => {
146259
+ fs$12 = (s, t, e) => {
146219
146260
  try {
146220
146261
  return Vt.lchownSync(s, t, e);
146221
146262
  } catch (i) {
@@ -146247,7 +146288,7 @@ while (this[Us](this[it].shift()));
146247
146288
  for (let l of n) Xn(s, l, t, e, a);
146248
146289
  });
146249
146290
  }, qn = (s, t, e, i) => {
146250
- t.isDirectory() && us(path.resolve(s, t.name), e, i), fs$11(path.resolve(s, t.name), e, i);
146291
+ t.isDirectory() && us(path.resolve(s, t.name), e, i), fs$12(path.resolve(s, t.name), e, i);
146251
146292
  }, us = (s, t, e) => {
146252
146293
  let i;
146253
146294
  try {
@@ -146255,11 +146296,11 @@ while (this[Us](this[it].shift()));
146255
146296
  } catch (r) {
146256
146297
  let n = r;
146257
146298
  if (n?.code === "ENOENT") return;
146258
- if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return fs$11(s, t, e);
146299
+ if (n?.code === "ENOTDIR" || n?.code === "ENOTSUP") return fs$12(s, t, e);
146259
146300
  throw n;
146260
146301
  }
146261
146302
  for (let r of i) qn(s, r, t, e);
146262
- return fs$11(s, t, e);
146303
+ return fs$12(s, t, e);
146263
146304
  };
146264
146305
  we$1 = class extends Error {
146265
146306
  path;
@@ -146294,7 +146335,7 @@ while (this[Us](this[it].shift()));
146294
146335
  E ? e(E) : x && a ? ds(x, o, h, (xe) => S(xe)) : n ? Vt.chmod(s, r, e) : e();
146295
146336
  };
146296
146337
  if (s === d) return Qn(s, S);
146297
- if (l) return jn.mkdir(s, {
146338
+ if (l) return fs.mkdir(s, {
146298
146339
  mode: r,
146299
146340
  recursive: !0
146300
146341
  }).then((E) => S(null, E ?? void 0), S);
@@ -147053,7 +147094,7 @@ var require_pend = /* @__PURE__ */ __commonJSMin(((exports, module) => {
147053
147094
  //#endregion
147054
147095
  //#region ../../node_modules/.pnpm/yauzl@3.3.0/node_modules/yauzl/fd-slicer.js
147055
147096
  var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147056
- var fs$10 = __require("fs");
147097
+ var fs$11 = __require("fs");
147057
147098
  var util$7 = __require("util");
147058
147099
  var stream$2 = __require("stream");
147059
147100
  var Readable = stream$2.Readable;
@@ -147078,7 +147119,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147078
147119
  FdSlicer.prototype.read = function(buffer, offset, length, position, callback) {
147079
147120
  var self = this;
147080
147121
  self.pend.go(function(cb) {
147081
- fs$10.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
147122
+ fs$11.read(self.fd, buffer, offset, length, position, function(err, bytesRead, buffer) {
147082
147123
  cb();
147083
147124
  callback(err, bytesRead, buffer);
147084
147125
  });
@@ -147087,7 +147128,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147087
147128
  FdSlicer.prototype.write = function(buffer, offset, length, position, callback) {
147088
147129
  var self = this;
147089
147130
  self.pend.go(function(cb) {
147090
- fs$10.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
147131
+ fs$11.write(self.fd, buffer, offset, length, position, function(err, written, buffer) {
147091
147132
  cb();
147092
147133
  callback(err, written, buffer);
147093
147134
  });
@@ -147107,7 +147148,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147107
147148
  self.refCount -= 1;
147108
147149
  if (self.refCount > 0) return;
147109
147150
  if (self.refCount < 0) throw new Error("invalid unref");
147110
- if (self.autoClose) fs$10.close(self.fd, onCloseDone);
147151
+ if (self.autoClose) fs$11.close(self.fd, onCloseDone);
147111
147152
  function onCloseDone(err) {
147112
147153
  if (err) self.emit("error", err);
147113
147154
  else self.emit("close");
@@ -147138,7 +147179,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147138
147179
  self.context.pend.go(function(cb) {
147139
147180
  if (self.destroyed) return cb();
147140
147181
  var buffer = Buffer.allocUnsafe(toRead);
147141
- fs$10.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
147182
+ fs$11.read(self.context.fd, buffer, 0, toRead, self.pos, function(err, bytesRead) {
147142
147183
  if (err) self.destroy(err);
147143
147184
  else if (bytesRead === 0) {
147144
147185
  self.destroyed = true;
@@ -147184,7 +147225,7 @@ var require_fd_slicer = /* @__PURE__ */ __commonJSMin(((exports) => {
147184
147225
  }
147185
147226
  self.context.pend.go(function(cb) {
147186
147227
  if (self.destroyed) return cb();
147187
- fs$10.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
147228
+ fs$11.write(self.context.fd, buffer, 0, buffer.length, self.pos, function(err, bytes) {
147188
147229
  if (err) {
147189
147230
  self.destroy();
147190
147231
  cb();
@@ -151376,6 +151417,17 @@ var init_turn = __esmMin((() => {
151376
151417
  const { signal } = ctx;
151377
151418
  if (this.flushSteerBuffer()) return { continue: true };
151378
151419
  signal.throwIfAborted();
151420
+ if (this.agent.printDrainAgentTasksOnStop) {
151421
+ const remaining = this.agent.printDrainDeadlineMs - Date.now();
151422
+ if (this.agent.background.list(true).some((task) => task.kind === "agent") && remaining > 0) {
151423
+ await this.agent.background.waitForActiveTasks((task) => task.kind === "agent", {
151424
+ timeoutMs: remaining,
151425
+ signal
151426
+ });
151427
+ this.flushSteerBuffer();
151428
+ return { continue: true };
151429
+ }
151430
+ }
151379
151431
  if (!goalOutcomeMessageContinuationUsed && isGoalOutcomeReminderOrigin(this.agent.context.history.at(-1)?.origin)) {
151380
151432
  goalOutcomeMessageContinuationUsed = true;
151381
151433
  if (!hasStepBudgetRemaining(loopControl?.maxStepsPerTurn, ctx.stepNumber)) {
@@ -153294,6 +153346,21 @@ var init_agent = __esmMin((() => {
153294
153346
  cron;
153295
153347
  goal;
153296
153348
  replayBuilder;
153349
+ /**
153350
+ * Print-mode (`kimi -p`) only: when true and the agent ends a turn while
153351
+ * background subagents (`kind === 'agent'`) are still running, the turn loop
153352
+ * holds the turn open and idle-waits until they finish, flushing their
153353
+ * completions into the turn so the model can react before the run exits. Set
153354
+ * by the session for print runs; defaults to false everywhere else.
153355
+ */
153356
+ printDrainAgentTasksOnStop = false;
153357
+ /**
153358
+ * Absolute deadline (ms epoch) bounding all print-mode drain waits for this
153359
+ * agent, derived from `background.printWaitCeilingS`. `Infinity` when the
153360
+ * drain is disabled. Shared across every drain hold within a single print
153361
+ * run so backfill rounds cannot exceed the ceiling in aggregate.
153362
+ */
153363
+ printDrainDeadlineMs = Number.POSITIVE_INFINITY;
153297
153364
  additionalDirs;
153298
153365
  activeProfile;
153299
153366
  brandHome;
@@ -182519,7 +182586,7 @@ var init_proxy = __esmMin((() => {
182519
182586
  var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182520
182587
  module.exports = isexe;
182521
182588
  isexe.sync = sync;
182522
- var fs$8 = __require("fs");
182589
+ var fs$9 = __require("fs");
182523
182590
  function checkPathExt(path, options) {
182524
182591
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
182525
182592
  if (!pathext) return true;
@@ -182536,12 +182603,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182536
182603
  return checkPathExt(path, options);
182537
182604
  }
182538
182605
  function isexe(path, options, cb) {
182539
- fs$8.stat(path, function(er, stat) {
182606
+ fs$9.stat(path, function(er, stat) {
182540
182607
  cb(er, er ? false : checkStat(stat, path, options));
182541
182608
  });
182542
182609
  }
182543
182610
  function sync(path, options) {
182544
- return checkStat(fs$8.statSync(path), path, options);
182611
+ return checkStat(fs$9.statSync(path), path, options);
182545
182612
  }
182546
182613
  }));
182547
182614
  //#endregion
@@ -182549,14 +182616,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182549
182616
  var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182550
182617
  module.exports = isexe;
182551
182618
  isexe.sync = sync;
182552
- var fs$7 = __require("fs");
182619
+ var fs$8 = __require("fs");
182553
182620
  function isexe(path, options, cb) {
182554
- fs$7.stat(path, function(er, stat) {
182621
+ fs$8.stat(path, function(er, stat) {
182555
182622
  cb(er, er ? false : checkStat(stat, options));
182556
182623
  });
182557
182624
  }
182558
182625
  function sync(path, options) {
182559
- return checkStat(fs$7.statSync(path), options);
182626
+ return checkStat(fs$8.statSync(path), options);
182560
182627
  }
182561
182628
  function checkStat(stat, options) {
182562
182629
  return stat.isFile() && checkMode(stat, options);
@@ -182620,7 +182687,7 @@ var require_isexe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182620
182687
  //#region ../../node_modules/.pnpm/which@2.0.2/node_modules/which/which.js
182621
182688
  var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182622
182689
  const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
182623
- const path$9 = __require("path");
182690
+ const path$10 = __require("path");
182624
182691
  const COLON = isWindows ? ";" : ":";
182625
182692
  const isexe = require_isexe();
182626
182693
  const getNotFoundError = (cmd) => Object.assign(/* @__PURE__ */ new Error(`not found: ${cmd}`), { code: "ENOENT" });
@@ -182650,7 +182717,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182650
182717
  if (i === pathEnv.length) return opt.all && found.length ? resolve(found) : reject(getNotFoundError(cmd));
182651
182718
  const ppRaw = pathEnv[i];
182652
182719
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
182653
- const pCmd = path$9.join(pathPart, cmd);
182720
+ const pCmd = path$10.join(pathPart, cmd);
182654
182721
  resolve(subStep(!pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd, i, 0));
182655
182722
  });
182656
182723
  const subStep = (p, i, ii) => new Promise((resolve, reject) => {
@@ -182671,7 +182738,7 @@ var require_which = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182671
182738
  for (let i = 0; i < pathEnv.length; i++) {
182672
182739
  const ppRaw = pathEnv[i];
182673
182740
  const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw;
182674
- const pCmd = path$9.join(pathPart, cmd);
182741
+ const pCmd = path$10.join(pathPart, cmd);
182675
182742
  const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd : pCmd;
182676
182743
  for (let j = 0; j < pathExt.length; j++) {
182677
182744
  const cur = p + pathExt[j];
@@ -182702,7 +182769,7 @@ var require_path_key = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182702
182769
  //#endregion
182703
182770
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/resolveCommand.js
182704
182771
  var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182705
- const path$8 = __require("path");
182772
+ const path$9 = __require("path");
182706
182773
  const which = require_which();
182707
182774
  const getPathKey = require_path_key();
182708
182775
  function resolveCommandAttempt(parsed, withoutPathExt) {
@@ -182717,12 +182784,12 @@ var require_resolveCommand = /* @__PURE__ */ __commonJSMin(((exports, module) =>
182717
182784
  try {
182718
182785
  resolved = which.sync(parsed.command, {
182719
182786
  path: env[getPathKey({ env })],
182720
- pathExt: withoutPathExt ? path$8.delimiter : void 0
182787
+ pathExt: withoutPathExt ? path$9.delimiter : void 0
182721
182788
  });
182722
182789
  } catch (e) {} finally {
182723
182790
  if (shouldSwitchCwd) process.chdir(cwd);
182724
182791
  }
182725
- if (resolved) resolved = path$8.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
182792
+ if (resolved) resolved = path$9.resolve(hasCustomCwd ? parsed.options.cwd : "", resolved);
182726
182793
  return resolved;
182727
182794
  }
182728
182795
  function resolveCommand(parsed) {
@@ -182771,16 +182838,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
182771
182838
  //#endregion
182772
182839
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/util/readShebang.js
182773
182840
  var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182774
- const fs$6 = __require("fs");
182841
+ const fs$7 = __require("fs");
182775
182842
  const shebangCommand = require_shebang_command();
182776
182843
  function readShebang(command) {
182777
182844
  const size = 150;
182778
182845
  const buffer = Buffer.alloc(size);
182779
182846
  let fd;
182780
182847
  try {
182781
- fd = fs$6.openSync(command, "r");
182782
- fs$6.readSync(fd, buffer, 0, size, 0);
182783
- fs$6.closeSync(fd);
182848
+ fd = fs$7.openSync(command, "r");
182849
+ fs$7.readSync(fd, buffer, 0, size, 0);
182850
+ fs$7.closeSync(fd);
182784
182851
  } catch (e) {}
182785
182852
  return shebangCommand(buffer.toString());
182786
182853
  }
@@ -182789,7 +182856,7 @@ var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182789
182856
  //#endregion
182790
182857
  //#region ../../node_modules/.pnpm/cross-spawn@7.0.6/node_modules/cross-spawn/lib/parse.js
182791
182858
  var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182792
- const path$7 = __require("path");
182859
+ const path$8 = __require("path");
182793
182860
  const resolveCommand = require_resolveCommand();
182794
182861
  const escape = require_escape();
182795
182862
  const readShebang = require_readShebang();
@@ -182812,7 +182879,7 @@ var require_parse$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
182812
182879
  const needsShell = !isExecutableRegExp.test(commandFile);
182813
182880
  if (parsed.options.forceShell || needsShell) {
182814
182881
  const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
182815
- parsed.command = path$7.normalize(parsed.command);
182882
+ parsed.command = path$8.normalize(parsed.command);
182816
182883
  parsed.command = escape.command(parsed.command);
182817
182884
  parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
182818
182885
  parsed.args = [
@@ -183911,6 +183978,11 @@ var init_session$1 = __esmMin((() => {
183911
183978
  }
183912
183979
  async createMain() {
183913
183980
  const { agent } = await this.createAgent({ type: "main" }, { profile: DEFAULT_AGENT_PROFILES["agent"] });
183981
+ if (this.options.drainAgentTasksOnStop) {
183982
+ const ceilingS = this.options.background?.printWaitCeilingS ?? 3600;
183983
+ agent.printDrainAgentTasksOnStop = true;
183984
+ agent.printDrainDeadlineMs = Date.now() + ceilingS * 1e3;
183985
+ }
183914
183986
  await this.triggerSessionStart("startup");
183915
183987
  return agent;
183916
183988
  }
@@ -189456,7 +189528,7 @@ function getEscaper(regex, map) {
189456
189528
  return result + data.substring(lastIdx);
189457
189529
  };
189458
189530
  }
189459
- var xmlReplacer, xmlCodeMap, getCodePoint, escapeAttribute$2, escapeText;
189531
+ var xmlReplacer, xmlCodeMap, getCodePoint, escapeAttribute$3, escapeText;
189460
189532
  var init_escape = __esmMin((() => {
189461
189533
  xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
189462
189534
  xmlCodeMap = new Map([
@@ -189467,7 +189539,7 @@ var init_escape = __esmMin((() => {
189467
189539
  [62, "&gt;"]
189468
189540
  ]);
189469
189541
  getCodePoint = String.prototype.codePointAt != null ? (str, index) => str.codePointAt(index) : (c, index) => (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index);
189470
- escapeAttribute$2 = getEscaper(/["&\u00A0]/g, new Map([
189542
+ escapeAttribute$3 = getEscaper(/["&\u00A0]/g, new Map([
189471
189543
  [34, "&quot;"],
189472
189544
  [38, "&amp;"],
189473
189545
  [160, "&nbsp;"]
@@ -189635,7 +189707,7 @@ function replaceQuotes(value) {
189635
189707
  function formatAttributes(attributes, opts) {
189636
189708
  var _a;
189637
189709
  if (!attributes) return;
189638
- const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute$2;
189710
+ const encode = ((_a = opts.encodeEntities) !== null && _a !== void 0 ? _a : opts.decodeEntities) === false ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute$3;
189639
189711
  return Object.keys(attributes).map((key) => {
189640
189712
  var _a, _b;
189641
189713
  const value = (_a = attributes[key]) !== null && _a !== void 0 ? _a : "";
@@ -199498,7 +199570,7 @@ var require_dist$5 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
199498
199570
  //#endregion
199499
199571
  //#region ../../node_modules/.pnpm/yazl@3.3.1/node_modules/yazl/index.js
199500
199572
  var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
199501
- var fs$5 = __require("fs");
199573
+ var fs$6 = __require("fs");
199502
199574
  var Transform$2 = __require("stream").Transform;
199503
199575
  var PassThrough$2 = __require("stream").PassThrough;
199504
199576
  var zlib$1 = __require("zlib");
@@ -199527,14 +199599,14 @@ var require_yazl = /* @__PURE__ */ __commonJSMin(((exports) => {
199527
199599
  if (shouldIgnoreAdding(self)) return;
199528
199600
  var entry = new Entry(metadataPath, false, options);
199529
199601
  self.entries.push(entry);
199530
- fs$5.stat(realPath, function(err, stats) {
199602
+ fs$6.stat(realPath, function(err, stats) {
199531
199603
  if (err) return self.emit("error", err);
199532
199604
  if (!stats.isFile()) return self.emit("error", /* @__PURE__ */ new Error("not a file: " + realPath));
199533
199605
  entry.uncompressedSize = stats.size;
199534
199606
  if (options.mtime == null) entry.setLastModDate(stats.mtime);
199535
199607
  if (options.mode == null) entry.setFileAttributesMode(stats.mode);
199536
199608
  entry.setFileDataPumpFunction(function() {
199537
- var readStream = fs$5.createReadStream(realPath);
199609
+ var readStream = fs$6.createReadStream(realPath);
199538
199610
  entry.state = Entry.FILE_DATA_IN_PROGRESS;
199539
199611
  readStream.on("error", function(err) {
199540
199612
  self.emit("error", err);
@@ -200921,7 +200993,7 @@ var require_clone = /* @__PURE__ */ __commonJSMin(((exports, module) => {
200921
200993
  //#endregion
200922
200994
  //#region ../../node_modules/.pnpm/graceful-fs@4.2.11/node_modules/graceful-fs/graceful-fs.js
200923
200995
  var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
200924
- var fs$4 = __require("fs");
200996
+ var fs$5 = __require("fs");
200925
200997
  var polyfills = require_polyfills();
200926
200998
  var legacy = require_legacy_streams();
200927
200999
  var clone = require_clone();
@@ -200950,36 +201022,36 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
200950
201022
  m = "GFS4: " + m.split(/\n/).join("\nGFS4: ");
200951
201023
  console.error(m);
200952
201024
  };
200953
- if (!fs$4[gracefulQueue]) {
200954
- publishQueue(fs$4, global[gracefulQueue] || []);
200955
- fs$4.close = (function(fs$close) {
201025
+ if (!fs$5[gracefulQueue]) {
201026
+ publishQueue(fs$5, global[gracefulQueue] || []);
201027
+ fs$5.close = (function(fs$close) {
200956
201028
  function close(fd, cb) {
200957
- return fs$close.call(fs$4, fd, function(err) {
201029
+ return fs$close.call(fs$5, fd, function(err) {
200958
201030
  if (!err) resetQueue();
200959
201031
  if (typeof cb === "function") cb.apply(this, arguments);
200960
201032
  });
200961
201033
  }
200962
201034
  Object.defineProperty(close, previousSymbol, { value: fs$close });
200963
201035
  return close;
200964
- })(fs$4.close);
200965
- fs$4.closeSync = (function(fs$closeSync) {
201036
+ })(fs$5.close);
201037
+ fs$5.closeSync = (function(fs$closeSync) {
200966
201038
  function closeSync(fd) {
200967
- fs$closeSync.apply(fs$4, arguments);
201039
+ fs$closeSync.apply(fs$5, arguments);
200968
201040
  resetQueue();
200969
201041
  }
200970
201042
  Object.defineProperty(closeSync, previousSymbol, { value: fs$closeSync });
200971
201043
  return closeSync;
200972
- })(fs$4.closeSync);
201044
+ })(fs$5.closeSync);
200973
201045
  if (/\bgfs4\b/i.test(process.env.NODE_DEBUG || "")) process.on("exit", function() {
200974
- debug(fs$4[gracefulQueue]);
200975
- __require("assert").equal(fs$4[gracefulQueue].length, 0);
201046
+ debug(fs$5[gracefulQueue]);
201047
+ __require("assert").equal(fs$5[gracefulQueue].length, 0);
200976
201048
  });
200977
201049
  }
200978
- if (!global[gracefulQueue]) publishQueue(global, fs$4[gracefulQueue]);
200979
- module.exports = patch(clone(fs$4));
200980
- if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$4.__patched) {
200981
- module.exports = patch(fs$4);
200982
- fs$4.__patched = true;
201050
+ if (!global[gracefulQueue]) publishQueue(global, fs$5[gracefulQueue]);
201051
+ module.exports = patch(clone(fs$5));
201052
+ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH && !fs$5.__patched) {
201053
+ module.exports = patch(fs$5);
201054
+ fs$5.__patched = true;
200983
201055
  }
200984
201056
  function patch(fs) {
200985
201057
  polyfills(fs);
@@ -201234,23 +201306,23 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
201234
201306
  }
201235
201307
  function enqueue(elem) {
201236
201308
  debug("ENQUEUE", elem[0].name, elem[1]);
201237
- fs$4[gracefulQueue].push(elem);
201309
+ fs$5[gracefulQueue].push(elem);
201238
201310
  retry();
201239
201311
  }
201240
201312
  var retryTimer;
201241
201313
  function resetQueue() {
201242
201314
  var now = Date.now();
201243
- for (var i = 0; i < fs$4[gracefulQueue].length; ++i) if (fs$4[gracefulQueue][i].length > 2) {
201244
- fs$4[gracefulQueue][i][3] = now;
201245
- fs$4[gracefulQueue][i][4] = now;
201315
+ for (var i = 0; i < fs$5[gracefulQueue].length; ++i) if (fs$5[gracefulQueue][i].length > 2) {
201316
+ fs$5[gracefulQueue][i][3] = now;
201317
+ fs$5[gracefulQueue][i][4] = now;
201246
201318
  }
201247
201319
  retry();
201248
201320
  }
201249
201321
  function retry() {
201250
201322
  clearTimeout(retryTimer);
201251
201323
  retryTimer = void 0;
201252
- if (fs$4[gracefulQueue].length === 0) return;
201253
- var elem = fs$4[gracefulQueue].shift();
201324
+ if (fs$5[gracefulQueue].length === 0) return;
201325
+ var elem = fs$5[gracefulQueue].shift();
201254
201326
  var fn = elem[0];
201255
201327
  var args = elem[1];
201256
201328
  var err = elem[2];
@@ -201269,7 +201341,7 @@ var require_graceful_fs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
201269
201341
  if (sinceAttempt >= Math.min(sinceStart * 1.2, 100)) {
201270
201342
  debug("RETRY", fn.name, args);
201271
201343
  fn.apply(null, args.concat([startTime]));
201272
- } else fs$4[gracefulQueue].push(elem);
201344
+ } else fs$5[gracefulQueue].push(elem);
201273
201345
  }
201274
201346
  if (retryTimer === void 0) retryTimer = setTimeout(retry, 0);
201275
201347
  }
@@ -201621,7 +201693,7 @@ var require_mtime_precision = /* @__PURE__ */ __commonJSMin(((exports, module) =
201621
201693
  //#endregion
201622
201694
  //#region ../../node_modules/.pnpm/proper-lockfile@4.1.2/node_modules/proper-lockfile/lib/lockfile.js
201623
201695
  var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
201624
- const path$6 = __require("path");
201696
+ const path$7 = __require("path");
201625
201697
  const fs = require_graceful_fs();
201626
201698
  const retry = require_retry();
201627
201699
  const onExit = require_signal_exit();
@@ -201631,7 +201703,7 @@ var require_lockfile = /* @__PURE__ */ __commonJSMin(((exports, module) => {
201631
201703
  return options.lockfilePath || `${file}.lock`;
201632
201704
  }
201633
201705
  function resolveCanonicalPath(file, options, callback) {
201634
- if (!options.realpath) return callback(null, path$6.resolve(file));
201706
+ if (!options.realpath) return callback(null, path$7.resolve(file));
201635
201707
  options.fs.realpath(file, callback);
201636
201708
  }
201637
201709
  function acquireLock(file, options, callback) {
@@ -205240,14 +205312,14 @@ async function readGitExecPath(deps, gitExe) {
205240
205312
  }
205241
205313
  }
205242
205314
  function gitBashCandidatesFromGitExe(gitExe) {
205243
- const normalizedGitExe = path$14.win32.normalize(normalizeWindowsPath(gitExe));
205244
- const gitDir = path$14.win32.dirname(normalizedGitExe);
205245
- const gitDirName = path$14.win32.basename(gitDir).toLowerCase();
205315
+ const normalizedGitExe = path$15.win32.normalize(normalizeWindowsPath(gitExe));
205316
+ const gitDir = path$15.win32.dirname(normalizedGitExe);
205317
+ const gitDirName = path$15.win32.basename(gitDir).toLowerCase();
205246
205318
  if (gitDirName !== "cmd" && gitDirName !== "bin") return;
205247
- return gitBashCandidatesFromGitRoot(path$14.win32.dirname(gitDir));
205319
+ return gitBashCandidatesFromGitRoot(path$15.win32.dirname(gitDir));
205248
205320
  }
205249
205321
  function gitBashCandidatesFromGitExecPath(execPath) {
205250
- const normalized = path$14.win32.normalize(normalizeWindowsPath(execPath));
205322
+ const normalized = path$15.win32.normalize(normalizeWindowsPath(execPath));
205251
205323
  const parts = normalized.split("\\");
205252
205324
  for (let i = parts.length - 1; i >= 0; i -= 1) {
205253
205325
  const segment = parts[i]?.toLowerCase();
@@ -205256,16 +205328,16 @@ function gitBashCandidatesFromGitExecPath(execPath) {
205256
205328
  if (root.length > 0) return gitBashCandidatesFromGitRoot(root);
205257
205329
  }
205258
205330
  }
205259
- return gitBashCandidatesFromGitRoot(path$14.win32.join(normalized, "..", ".."));
205331
+ return gitBashCandidatesFromGitRoot(path$15.win32.join(normalized, "..", ".."));
205260
205332
  }
205261
205333
  function gitBashCandidatesFromGitRoot(root) {
205262
- return [path$14.win32.normalize(path$14.win32.join(root, "bin", "bash.exe")), path$14.win32.normalize(path$14.win32.join(root, "usr", "bin", "bash.exe"))];
205334
+ return [path$15.win32.normalize(path$15.win32.join(root, "bin", "bash.exe")), path$15.win32.normalize(path$15.win32.join(root, "usr", "bin", "bash.exe"))];
205263
205335
  }
205264
205336
  function normalizeWindowsPath(path) {
205265
205337
  return path.replaceAll("/", "\\");
205266
205338
  }
205267
205339
  function isAbsoluteWindowsPath(path) {
205268
- return path$14.win32.isAbsolute(normalizeWindowsPath(path));
205340
+ return path$15.win32.isAbsolute(normalizeWindowsPath(path));
205269
205341
  }
205270
205342
  function dedupeWindowsPaths(paths) {
205271
205343
  const deduped = [];
@@ -206479,7 +206551,8 @@ var init_core_impl = __esmMin((() => {
206479
206551
  pluginSessionStarts,
206480
206552
  pluginCommands,
206481
206553
  appVersion: this.appVersion,
206482
- additionalDirs
206554
+ additionalDirs,
206555
+ drainAgentTasksOnStop: options.drainAgentTasksOnStop
206483
206556
  });
206484
206557
  try {
206485
206558
  session.metadata = {
@@ -224200,7 +224273,7 @@ var TUI = class TUI extends Container {
224200
224273
  else this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
224201
224274
  const bufferLength = Math.max(height, newLines.length);
224202
224275
  this.previousViewportTop = Math.max(0, bufferLength - height);
224203
- this.positionHardwareCursor(cursorPos, newLines.length, this.previousViewportTop, height);
224276
+ this.positionHardwareCursor(cursorPos, newLines.length);
224204
224277
  this.previousLines = newLines;
224205
224278
  this.previousKittyImageIds = this.collectKittyImageIds(newLines);
224206
224279
  this.previousWidth = width;
@@ -224209,9 +224282,9 @@ var TUI = class TUI extends Container {
224209
224282
  const debugRedraw = process.env["PI_DEBUG_REDRAW"] === "1";
224210
224283
  const logRedraw = (reason) => {
224211
224284
  if (!debugRedraw) return;
224212
- const logPath = path$14.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
224285
+ const logPath = path$15.join(nodeOs.homedir(), ".pi", "agent", "pi-debug.log");
224213
224286
  const msg = `[${(/* @__PURE__ */ new Date()).toISOString()}] fullRender: ${reason} (prev=${this.previousLines.length}, new=${newLines.length}, height=${height})\n`;
224214
- fs$15.appendFileSync(logPath, msg);
224287
+ fs$16.appendFileSync(logPath, msg);
224215
224288
  };
224216
224289
  if (this.previousLines.length === 0 && !widthChanged && !heightChanged) {
224217
224290
  logRedraw("first render");
@@ -224233,55 +224306,6 @@ var TUI = class TUI extends Container {
224233
224306
  fullRender(true);
224234
224307
  return;
224235
224308
  }
224236
- const repaintViewport = (desiredTop, reason) => {
224237
- const advance = Math.max(0, desiredTop - prevViewportTop);
224238
- const paintStart = advance > 0 ? prevViewportTop : desiredTop;
224239
- const paintCount = height + advance;
224240
- for (let r = 0; r < paintCount; r++) {
224241
- const idx = paintStart + r;
224242
- if (idx < newLines.length && isImageLine$1(newLines[idx])) {
224243
- logRedraw(`viewport repaint hit kitty image at line ${idx}`);
224244
- fullRender(true);
224245
- return;
224246
- }
224247
- }
224248
- logRedraw(`viewport repaint: ${reason}`);
224249
- let repaint = "\x1B[?2026h";
224250
- let deleteFrom = prevViewportTop;
224251
- for (let k = 0; k < prevViewportTop; k++) {
224252
- if (!isImageLine$1(this.previousLines[k] ?? "")) continue;
224253
- if (k + this.getKittyImageReservedRows(this.previousLines, k) - 1 >= prevViewportTop) {
224254
- deleteFrom = k;
224255
- break;
224256
- }
224257
- }
224258
- repaint += this.deleteChangedKittyImages(deleteFrom, this.previousLines.length - 1);
224259
- const cursorScreenRow = Math.max(0, Math.min(height - 1, hardwareCursorRow - prevViewportTop));
224260
- if (cursorScreenRow > 0) repaint += `\x1b[${cursorScreenRow}A`;
224261
- repaint += "\r";
224262
- for (let r = 0; r < paintCount; r++) {
224263
- if (r > 0) repaint += "\r\n";
224264
- repaint += "\x1B[2K";
224265
- const idx = paintStart + r;
224266
- if (idx < newLines.length) repaint += newLines[idx];
224267
- }
224268
- repaint += "\x1B[?2026l";
224269
- this.terminal.write(repaint);
224270
- this.cursorRow = Math.max(0, newLines.length - 1);
224271
- this.hardwareCursorRow = desiredTop + height - 1;
224272
- this.previousViewportTop = desiredTop;
224273
- this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
224274
- this.positionHardwareCursor(cursorPos, newLines.length, desiredTop, height);
224275
- this.previousLines = newLines;
224276
- this.previousKittyImageIds = this.collectKittyImageIds(newLines);
224277
- this.previousWidth = width;
224278
- this.previousHeight = height;
224279
- };
224280
- const desiredViewportTop = Math.max(0, newLines.length - height);
224281
- if (prevViewportTop > desiredViewportTop && newLines.length <= prevViewportTop) {
224282
- repaintViewport(desiredViewportTop, `re-anchor after collapse (viewportTop ${prevViewportTop} -> ${desiredViewportTop}, newLines=${newLines.length})`);
224283
- return;
224284
- }
224285
224309
  let firstChanged = -1;
224286
224310
  let lastChanged = -1;
224287
224311
  const maxLines = Math.max(newLines.length, this.previousLines.length);
@@ -224301,7 +224325,7 @@ var TUI = class TUI extends Container {
224301
224325
  }
224302
224326
  const appendStart = appendedLines && firstChanged === this.previousLines.length && firstChanged > 0;
224303
224327
  if (firstChanged === -1) {
224304
- this.positionHardwareCursor(cursorPos, newLines.length, prevViewportTop, height);
224328
+ this.positionHardwareCursor(cursorPos, newLines.length);
224305
224329
  this.previousViewportTop = prevViewportTop;
224306
224330
  this.previousHeight = height;
224307
224331
  return;
@@ -224339,7 +224363,7 @@ var TUI = class TUI extends Container {
224339
224363
  this.cursorRow = targetRow;
224340
224364
  this.hardwareCursorRow = targetRow;
224341
224365
  }
224342
- this.positionHardwareCursor(cursorPos, newLines.length, prevViewportTop, height);
224366
+ this.positionHardwareCursor(cursorPos, newLines.length);
224343
224367
  this.previousLines = newLines;
224344
224368
  this.previousKittyImageIds = this.collectKittyImageIds(newLines);
224345
224369
  this.previousWidth = width;
@@ -224348,32 +224372,9 @@ var TUI = class TUI extends Container {
224348
224372
  return;
224349
224373
  }
224350
224374
  if (firstChanged < prevViewportTop) {
224351
- let visibleFirstChanged = -1;
224352
- for (let i = prevViewportTop; i <= lastChanged; i++) if ((i < this.previousLines.length ? this.previousLines[i] : "") !== (i < newLines.length ? newLines[i] : "")) {
224353
- visibleFirstChanged = i;
224354
- break;
224355
- }
224356
- if (visibleFirstChanged === -1) {
224357
- logRedraw(`all changes above viewport (firstChanged=${firstChanged} < ${prevViewportTop})`);
224358
- this.positionHardwareCursor(cursorPos, newLines.length, prevViewportTop, height);
224359
- this.previousLines = newLines;
224360
- this.previousKittyImageIds = this.collectKittyImageIds(newLines);
224361
- this.previousWidth = width;
224362
- this.previousHeight = height;
224363
- this.previousViewportTop = prevViewportTop;
224364
- return;
224365
- }
224366
- if (visibleFirstChanged >= newLines.length) {
224367
- repaintViewport(prevViewportTop, `deleted tail within pinned viewport (newLines=${newLines.length}, viewportTop=${prevViewportTop})`);
224368
- return;
224369
- }
224370
- if (newLines.length !== this.previousLines.length) {
224371
- const repaintTop = Math.max(desiredViewportTop, prevViewportTop);
224372
- repaintViewport(repaintTop, `re-anchor after above-viewport length change (${this.previousLines.length} -> ${newLines.length}, viewportTop ${prevViewportTop} -> ${repaintTop})`);
224373
- return;
224374
- }
224375
- logRedraw(`clamped firstChanged ${firstChanged} -> ${visibleFirstChanged} (viewportTop=${prevViewportTop})`);
224376
- firstChanged = visibleFirstChanged;
224375
+ logRedraw(`firstChanged < viewportTop (${firstChanged} < ${prevViewportTop})`);
224376
+ fullRender(true);
224377
+ return;
224377
224378
  }
224378
224379
  let buffer = "\x1B[?2026h";
224379
224380
  buffer += this.deleteChangedKittyImages(firstChanged, lastChanged);
@@ -224424,16 +224425,14 @@ var TUI = class TUI extends Container {
224424
224425
  finalCursorRow = newLines.length - 1;
224425
224426
  }
224426
224427
  const extraLines = this.previousLines.length - newLines.length;
224427
- const rowsBelowCursor = height - 1 - (finalCursorRow - viewportTop);
224428
- const clearLines = Math.max(0, Math.min(extraLines, rowsBelowCursor));
224429
- for (let i = 0; i < clearLines; i++) buffer += "\r\n\x1B[2K";
224430
- if (clearLines > 0) buffer += `\x1b[${clearLines}A`;
224428
+ for (let i = newLines.length; i < this.previousLines.length; i++) buffer += "\r\n\x1B[2K";
224429
+ buffer += `\x1b[${extraLines}A`;
224431
224430
  }
224432
224431
  buffer += "\x1B[?2026l";
224433
224432
  if (process.env["PI_TUI_DEBUG"] === "1") {
224434
224433
  const debugDir = "/tmp/tui";
224435
- fs$15.mkdirSync(debugDir, { recursive: true });
224436
- const debugPath = path$14.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
224434
+ fs$16.mkdirSync(debugDir, { recursive: true });
224435
+ const debugPath = path$15.join(debugDir, `render-${Date.now()}-${Math.random().toString(36).slice(2)}.log`);
224437
224436
  const debugData = [
224438
224437
  `firstChanged: ${firstChanged}`,
224439
224438
  `viewportTop: ${viewportTop}`,
@@ -224456,14 +224455,14 @@ var TUI = class TUI extends Container {
224456
224455
  "=== buffer ===",
224457
224456
  JSON.stringify(buffer)
224458
224457
  ].join("\n");
224459
- fs$15.writeFileSync(debugPath, debugData);
224458
+ fs$16.writeFileSync(debugPath, debugData);
224460
224459
  }
224461
224460
  this.terminal.write(buffer);
224462
224461
  this.cursorRow = Math.max(0, newLines.length - 1);
224463
224462
  this.hardwareCursorRow = finalCursorRow;
224464
224463
  this.maxLinesRendered = Math.max(this.maxLinesRendered, newLines.length);
224465
224464
  this.previousViewportTop = Math.max(prevViewportTop, finalCursorRow - height + 1);
224466
- this.positionHardwareCursor(cursorPos, newLines.length, this.previousViewportTop, height);
224465
+ this.positionHardwareCursor(cursorPos, newLines.length);
224467
224466
  this.previousLines = newLines;
224468
224467
  this.previousKittyImageIds = this.collectKittyImageIds(newLines);
224469
224468
  this.previousWidth = width;
@@ -224473,20 +224472,14 @@ var TUI = class TUI extends Container {
224473
224472
  * Position the hardware cursor for IME candidate window.
224474
224473
  * @param cursorPos The cursor position extracted from rendered output, or null
224475
224474
  * @param totalLines Total number of rendered lines
224476
- * @param viewportTop Logical row shown on the top screen row after this frame
224477
- * @param height Terminal height (visible viewport size)
224478
224475
  */
224479
- positionHardwareCursor(cursorPos, totalLines, viewportTop, height) {
224476
+ positionHardwareCursor(cursorPos, totalLines) {
224480
224477
  if (!cursorPos || totalLines <= 0) {
224481
224478
  this.terminal.hideCursor();
224482
224479
  return;
224483
224480
  }
224484
224481
  const targetRow = Math.max(0, Math.min(cursorPos.row, totalLines - 1));
224485
224482
  const targetCol = Math.max(0, cursorPos.col);
224486
- if (targetRow < viewportTop || targetRow >= viewportTop + height) {
224487
- this.terminal.hideCursor();
224488
- return;
224489
- }
224490
224483
  const rowDelta = targetRow - this.hardwareCursorRow;
224491
224484
  let buffer = "";
224492
224485
  if (rowDelta > 0) buffer += `\x1b[${rowDelta}B`;
@@ -229023,12 +229016,12 @@ function loadNativeModifiersHelper() {
229023
229016
  if (process.platform !== "darwin") return void 0;
229024
229017
  const arch = process.arch;
229025
229018
  if (arch !== "x64" && arch !== "arm64") return void 0;
229026
- const moduleDir = path$14.dirname(fileURLToPath(import.meta.url));
229027
- const nativePath = path$14.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
229019
+ const moduleDir = path$15.dirname(fileURLToPath(import.meta.url));
229020
+ const nativePath = path$15.join("native", "darwin", "prebuilds", `darwin-${arch}`, "darwin-modifiers.node");
229028
229021
  const candidates = [
229029
- path$14.join(moduleDir, "..", nativePath),
229030
- path$14.join(moduleDir, nativePath),
229031
- path$14.join(path$14.dirname(process.execPath), nativePath)
229022
+ path$15.join(moduleDir, "..", nativePath),
229023
+ path$15.join(moduleDir, nativePath),
229024
+ path$15.join(path$15.dirname(process.execPath), nativePath)
229032
229025
  ];
229033
229026
  for (const modulePath of candidates) try {
229034
229027
  const helper = cjsRequire$1(modulePath);
@@ -229094,10 +229087,10 @@ var ProcessTerminal = class {
229094
229087
  const env = process.env["PI_TUI_WRITE_LOG"] || "";
229095
229088
  if (!env) return "";
229096
229089
  try {
229097
- if (fs$15.statSync(env).isDirectory()) {
229090
+ if (fs$16.statSync(env).isDirectory()) {
229098
229091
  const now = /* @__PURE__ */ new Date();
229099
229092
  const ts = `${now.getFullYear()}-${String(now.getMonth() + 1).padStart(2, "0")}-${String(now.getDate()).padStart(2, "0")}_${String(now.getHours()).padStart(2, "0")}-${String(now.getMinutes()).padStart(2, "0")}-${String(now.getSeconds()).padStart(2, "0")}`;
229100
- return path$14.join(env, `tui-${ts}-${process.pid}.log`);
229093
+ return path$15.join(env, `tui-${ts}-${process.pid}.log`);
229101
229094
  }
229102
229095
  } catch {}
229103
229096
  return env;
@@ -229257,12 +229250,12 @@ var ProcessTerminal = class {
229257
229250
  try {
229258
229251
  const arch = process.arch;
229259
229252
  if (arch !== "x64" && arch !== "arm64") return;
229260
- const moduleDir = path$14.dirname(fileURLToPath(import.meta.url));
229261
- const nativePath = path$14.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
229253
+ const moduleDir = path$15.dirname(fileURLToPath(import.meta.url));
229254
+ const nativePath = path$15.join("native", "win32", "prebuilds", `win32-${arch}`, "win32-console-mode.node");
229262
229255
  const candidates = [
229263
- path$14.join(moduleDir, "..", nativePath),
229264
- path$14.join(moduleDir, nativePath),
229265
- path$14.join(path$14.dirname(process.execPath), nativePath)
229256
+ path$15.join(moduleDir, "..", nativePath),
229257
+ path$15.join(moduleDir, nativePath),
229258
+ path$15.join(path$15.dirname(process.execPath), nativePath)
229266
229259
  ];
229267
229260
  for (const modulePath of candidates) try {
229268
229261
  cjsRequire(modulePath).enableVirtualTerminalInput?.();
@@ -229332,7 +229325,7 @@ var ProcessTerminal = class {
229332
229325
  write(data) {
229333
229326
  process.stdout.write(data);
229334
229327
  if (this.writeLogPath) try {
229335
- fs$15.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
229328
+ fs$16.appendFileSync(this.writeLogPath, data, { encoding: "utf8" });
229336
229329
  } catch {}
229337
229330
  }
229338
229331
  get columns() {
@@ -231527,8 +231520,8 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
231527
231520
  var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
231528
231521
  const EventEmitter$10 = __require("node:events").EventEmitter;
231529
231522
  const childProcess = __require("node:child_process");
231530
- const path$5 = __require("node:path");
231531
- const fs$3 = __require("node:fs");
231523
+ const path$6 = __require("node:path");
231524
+ const fs$4 = __require("node:fs");
231532
231525
  const process$2 = __require("node:process");
231533
231526
  const { Argument, humanReadableArgName } = require_argument();
231534
231527
  const { CommanderError } = require_error$2();
@@ -232411,7 +232404,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
232411
232404
  * @param {string} subcommandName
232412
232405
  */
232413
232406
  _checkForMissingExecutable(executableFile, executableDir, subcommandName) {
232414
- if (fs$3.existsSync(executableFile)) return;
232407
+ if (fs$4.existsSync(executableFile)) return;
232415
232408
  const executableMissing = `'${executableFile}' does not exist
232416
232409
  - if '${subcommandName}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
232417
232410
  - if the default executable name is not suitable, use the executableFile option to supply a custom name or path
@@ -232434,10 +232427,10 @@ Expecting one of '${allowedValues.join("', '")}'`);
232434
232427
  ".cjs"
232435
232428
  ];
232436
232429
  function findFile(baseDir, baseName) {
232437
- const localBin = path$5.resolve(baseDir, baseName);
232438
- if (fs$3.existsSync(localBin)) return localBin;
232439
- if (sourceExt.includes(path$5.extname(baseName))) return void 0;
232440
- const foundExt = sourceExt.find((ext) => fs$3.existsSync(`${localBin}${ext}`));
232430
+ const localBin = path$6.resolve(baseDir, baseName);
232431
+ if (fs$4.existsSync(localBin)) return localBin;
232432
+ if (sourceExt.includes(path$6.extname(baseName))) return void 0;
232433
+ const foundExt = sourceExt.find((ext) => fs$4.existsSync(`${localBin}${ext}`));
232441
232434
  if (foundExt) return `${localBin}${foundExt}`;
232442
232435
  }
232443
232436
  this._checkForMissingMandatoryOptions();
@@ -232447,21 +232440,21 @@ Expecting one of '${allowedValues.join("', '")}'`);
232447
232440
  if (this._scriptPath) {
232448
232441
  let resolvedScriptPath;
232449
232442
  try {
232450
- resolvedScriptPath = fs$3.realpathSync(this._scriptPath);
232443
+ resolvedScriptPath = fs$4.realpathSync(this._scriptPath);
232451
232444
  } catch {
232452
232445
  resolvedScriptPath = this._scriptPath;
232453
232446
  }
232454
- executableDir = path$5.resolve(path$5.dirname(resolvedScriptPath), executableDir);
232447
+ executableDir = path$6.resolve(path$6.dirname(resolvedScriptPath), executableDir);
232455
232448
  }
232456
232449
  if (executableDir) {
232457
232450
  let localFile = findFile(executableDir, executableFile);
232458
232451
  if (!localFile && !subcommand._executableFile && this._scriptPath) {
232459
- const legacyName = path$5.basename(this._scriptPath, path$5.extname(this._scriptPath));
232452
+ const legacyName = path$6.basename(this._scriptPath, path$6.extname(this._scriptPath));
232460
232453
  if (legacyName !== this._name) localFile = findFile(executableDir, `${legacyName}-${subcommand._name}`);
232461
232454
  }
232462
232455
  executableFile = localFile || executableFile;
232463
232456
  }
232464
- launchWithNode = sourceExt.includes(path$5.extname(executableFile));
232457
+ launchWithNode = sourceExt.includes(path$6.extname(executableFile));
232465
232458
  let proc;
232466
232459
  if (process$2.platform !== "win32") if (launchWithNode) {
232467
232460
  args.unshift(executableFile);
@@ -233165,7 +233158,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
233165
233158
  * @return {Command}
233166
233159
  */
233167
233160
  nameFromFilename(filename) {
233168
- this._name = path$5.basename(filename, path$5.extname(filename));
233161
+ this._name = path$6.basename(filename, path$6.extname(filename));
233169
233162
  return this;
233170
233163
  }
233171
233164
  /**
@@ -245499,10 +245492,10 @@ var require_atomic_sleep = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245499
245492
  //#endregion
245500
245493
  //#region ../../node_modules/.pnpm/sonic-boom@4.2.1/node_modules/sonic-boom/index.js
245501
245494
  var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245502
- const fs$2 = __require("fs");
245495
+ const fs$3 = __require("fs");
245503
245496
  const EventEmitter$8 = __require("events");
245504
245497
  const inherits$6 = __require("util").inherits;
245505
- const path$4 = __require("path");
245498
+ const path$5 = __require("path");
245506
245499
  const sleep = require_atomic_sleep();
245507
245500
  const assert$8 = __require("assert");
245508
245501
  const BUSY_WRITE_TIMEOUT = 100;
@@ -245542,17 +245535,17 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245542
245535
  const flags = sonic.append ? "a" : "w";
245543
245536
  const mode = sonic.mode;
245544
245537
  if (sonic.sync) try {
245545
- if (sonic.mkdir) fs$2.mkdirSync(path$4.dirname(file), { recursive: true });
245546
- fileOpened(null, fs$2.openSync(file, flags, mode));
245538
+ if (sonic.mkdir) fs$3.mkdirSync(path$5.dirname(file), { recursive: true });
245539
+ fileOpened(null, fs$3.openSync(file, flags, mode));
245547
245540
  } catch (err) {
245548
245541
  fileOpened(err);
245549
245542
  throw err;
245550
245543
  }
245551
- else if (sonic.mkdir) fs$2.mkdir(path$4.dirname(file), { recursive: true }, (err) => {
245544
+ else if (sonic.mkdir) fs$3.mkdir(path$5.dirname(file), { recursive: true }, (err) => {
245552
245545
  if (err) return fileOpened(err);
245553
- fs$2.open(file, flags, mode, fileOpened);
245546
+ fs$3.open(file, flags, mode, fileOpened);
245554
245547
  });
245555
- else fs$2.open(file, flags, mode, fileOpened);
245548
+ else fs$3.open(file, flags, mode, fileOpened);
245556
245549
  }
245557
245550
  function SonicBoom(opts) {
245558
245551
  if (!(this instanceof SonicBoom)) return new SonicBoom(opts);
@@ -245590,8 +245583,8 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245590
245583
  this.flush = flushBuffer;
245591
245584
  this.flushSync = flushBufferSync;
245592
245585
  this._actualWrite = actualWriteBuffer;
245593
- fsWriteSync = () => fs$2.writeSync(this.fd, this._writingBuf);
245594
- fsWrite = () => fs$2.write(this.fd, this._writingBuf, this.release);
245586
+ fsWriteSync = () => fs$3.writeSync(this.fd, this._writingBuf);
245587
+ fsWrite = () => fs$3.write(this.fd, this._writingBuf, this.release);
245595
245588
  } else if (contentMode === void 0 || contentMode === kContentModeUtf8) {
245596
245589
  this._writingBuf = "";
245597
245590
  this.write = write;
@@ -245599,12 +245592,12 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245599
245592
  this.flushSync = flushSync;
245600
245593
  this._actualWrite = actualWrite;
245601
245594
  fsWriteSync = () => {
245602
- if (Buffer.isBuffer(this._writingBuf)) return fs$2.writeSync(this.fd, this._writingBuf);
245603
- return fs$2.writeSync(this.fd, this._writingBuf, "utf8");
245595
+ if (Buffer.isBuffer(this._writingBuf)) return fs$3.writeSync(this.fd, this._writingBuf);
245596
+ return fs$3.writeSync(this.fd, this._writingBuf, "utf8");
245604
245597
  };
245605
245598
  fsWrite = () => {
245606
- if (Buffer.isBuffer(this._writingBuf)) return fs$2.write(this.fd, this._writingBuf, this.release);
245607
- return fs$2.write(this.fd, this._writingBuf, "utf8", this.release);
245599
+ if (Buffer.isBuffer(this._writingBuf)) return fs$3.write(this.fd, this._writingBuf, this.release);
245600
+ return fs$3.write(this.fd, this._writingBuf, "utf8", this.release);
245608
245601
  };
245609
245602
  } else throw new Error(`SonicBoom supports "${kContentModeUtf8}" and "${kContentModeBuffer}", but passed ${contentMode}`);
245610
245603
  if (typeof fd === "number") {
@@ -245649,7 +245642,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245649
245642
  return;
245650
245643
  }
245651
245644
  }
245652
- if (this._fsync) fs$2.fsyncSync(this.fd);
245645
+ if (this._fsync) fs$3.fsyncSync(this.fd);
245653
245646
  const len = this._len;
245654
245647
  if (this._reopening) {
245655
245648
  this._writing = false;
@@ -245746,7 +245739,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245746
245739
  this._flushPending = true;
245747
245740
  const onDrain = () => {
245748
245741
  if (!this._fsync) try {
245749
- fs$2.fsync(this.fd, (err) => {
245742
+ fs$3.fsync(this.fd, (err) => {
245750
245743
  this._flushPending = false;
245751
245744
  cb(err);
245752
245745
  });
@@ -245823,7 +245816,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245823
245816
  if (this._writing) return;
245824
245817
  const fd = this.fd;
245825
245818
  this.once("ready", () => {
245826
- if (fd !== this.fd) fs$2.close(fd, (err) => {
245819
+ if (fd !== this.fd) fs$3.close(fd, (err) => {
245827
245820
  if (err) return this.emit("error", err);
245828
245821
  });
245829
245822
  });
@@ -245854,7 +245847,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245854
245847
  while (this._bufs.length || buf.length) {
245855
245848
  if (buf.length <= 0) buf = this._bufs[0];
245856
245849
  try {
245857
- const n = Buffer.isBuffer(buf) ? fs$2.writeSync(this.fd, buf) : fs$2.writeSync(this.fd, buf, "utf8");
245850
+ const n = Buffer.isBuffer(buf) ? fs$3.writeSync(this.fd, buf) : fs$3.writeSync(this.fd, buf, "utf8");
245858
245851
  const releasedBufObj = releaseWritingBuf(buf, this._len, n);
245859
245852
  buf = releasedBufObj.writingBuf;
245860
245853
  this._len = releasedBufObj.len;
@@ -245865,7 +245858,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245865
245858
  }
245866
245859
  }
245867
245860
  try {
245868
- fs$2.fsyncSync(this.fd);
245861
+ fs$3.fsyncSync(this.fd);
245869
245862
  } catch {}
245870
245863
  }
245871
245864
  function flushBufferSync() {
@@ -245879,7 +245872,7 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245879
245872
  while (this._bufs.length || buf.length) {
245880
245873
  if (buf.length <= 0) buf = mergeBuf(this._bufs[0], this._lens[0]);
245881
245874
  try {
245882
- const n = fs$2.writeSync(this.fd, buf);
245875
+ const n = fs$3.writeSync(this.fd, buf);
245883
245876
  buf = buf.subarray(n);
245884
245877
  this._len = Math.max(this._len - n, 0);
245885
245878
  if (buf.length <= 0) {
@@ -245901,24 +245894,24 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245901
245894
  this._writing = true;
245902
245895
  this._writingBuf = this._writingBuf.length ? this._writingBuf : this._bufs.shift() || "";
245903
245896
  if (this.sync) try {
245904
- release(null, Buffer.isBuffer(this._writingBuf) ? fs$2.writeSync(this.fd, this._writingBuf) : fs$2.writeSync(this.fd, this._writingBuf, "utf8"));
245897
+ release(null, Buffer.isBuffer(this._writingBuf) ? fs$3.writeSync(this.fd, this._writingBuf) : fs$3.writeSync(this.fd, this._writingBuf, "utf8"));
245905
245898
  } catch (err) {
245906
245899
  release(err);
245907
245900
  }
245908
- else fs$2.write(this.fd, this._writingBuf, release);
245901
+ else fs$3.write(this.fd, this._writingBuf, release);
245909
245902
  }
245910
245903
  function actualWriteBuffer() {
245911
245904
  const release = this.release;
245912
245905
  this._writing = true;
245913
245906
  this._writingBuf = this._writingBuf.length ? this._writingBuf : mergeBuf(this._bufs.shift(), this._lens.shift());
245914
245907
  if (this.sync) try {
245915
- release(null, fs$2.writeSync(this.fd, this._writingBuf));
245908
+ release(null, fs$3.writeSync(this.fd, this._writingBuf));
245916
245909
  } catch (err) {
245917
245910
  release(err);
245918
245911
  }
245919
245912
  else {
245920
245913
  if (kCopyBuffer) this._writingBuf = Buffer.from(this._writingBuf);
245921
- fs$2.write(this.fd, this._writingBuf, release);
245914
+ fs$3.write(this.fd, this._writingBuf, release);
245922
245915
  }
245923
245916
  }
245924
245917
  function actualClose(sonic) {
@@ -245932,10 +245925,10 @@ var require_sonic_boom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
245932
245925
  sonic._lens = [];
245933
245926
  assert$8(typeof sonic.fd === "number", `sonic.fd must be a number, got ${typeof sonic.fd}`);
245934
245927
  try {
245935
- fs$2.fsync(sonic.fd, closeWrapped);
245928
+ fs$3.fsync(sonic.fd, closeWrapped);
245936
245929
  } catch {}
245937
245930
  function closeWrapped() {
245938
- if (sonic.fd !== 1 && sonic.fd !== 2) fs$2.close(sonic.fd, done);
245931
+ if (sonic.fd !== 1 && sonic.fd !== 2) fs$3.close(sonic.fd, done);
245939
245932
  else done();
245940
245933
  }
245941
245934
  function done(err) {
@@ -266337,6 +266330,7 @@ function extractBearer(header) {
266337
266330
  function createAuthHook(authTokenService, opts) {
266338
266331
  const isBypassed = opts?.isBypassed ?? defaultIsBypassed;
266339
266332
  return async (req, reply) => {
266333
+ if (opts?.disabled === true) return;
266340
266334
  if (opts?.limiter?.isBanned(req.ip) === true) return reply.code(429).send(errEnvelope(AUTH_RATE_LIMIT_CODE, AUTH_RATE_LIMIT_MSG, req.id));
266341
266335
  const header = req.headers.authorization;
266342
266336
  const token = extractBearer(header);
@@ -270450,7 +270444,7 @@ let WSGateway = class WSGateway extends Disposable {
270450
270444
  return;
270451
270445
  }
270452
270446
  const authTokenService = this.authTokenService;
270453
- if (authTokenService !== void 0) {
270447
+ if (authTokenService !== void 0 && this.options.dangerousBypassAuth !== true) {
270454
270448
  const authorization = req.headers.authorization;
270455
270449
  const token = authorization?.startsWith("Bearer ") ? authorization.slice(7) : extractWsBearerToken(req.headers["sec-websocket-protocol"]);
270456
270450
  let ok = false;
@@ -273304,7 +273298,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
273304
273298
  const fp = require_plugin();
273305
273299
  const { createWriteStream: createWriteStream$2 } = __require("node:fs");
273306
273300
  const { unlink: unlink$1 } = __require("node:fs/promises");
273307
- const path$3 = __require("node:path");
273301
+ const path$4 = __require("node:path");
273308
273302
  const { generateId } = require_generateId();
273309
273303
  const createError = require_error$1();
273310
273304
  const streamToNull = require_stream_consumer();
@@ -273599,7 +273593,7 @@ var import_multipart = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((
273599
273593
  for await (const part of parts) {
273600
273594
  values = part.fields;
273601
273595
  if (!part.file) continue;
273602
- const filepath = path$3.join(tmpdir, generateId() + path$3.extname(part.filename || "file" + i++));
273596
+ const filepath = path$4.join(tmpdir, generateId() + path$4.extname(part.filename || "file" + i++));
273603
273597
  const target = createWriteStream$2(filepath);
273604
273598
  try {
273605
273599
  this.tmpUploads.push(filepath);
@@ -273765,7 +273759,17 @@ function registerFilesRoutes(app, ix) {
273765
273759
  const { file_id } = req.params;
273766
273760
  const { meta, blobPath } = await ix.invokeFunction((a) => a.get(IFileStore)).get(file_id);
273767
273761
  const r = reply;
273768
- r.type(meta.media_type).header("content-disposition", buildContentDisposition(meta.name)).header("content-length", meta.size).header("etag", `"${meta.id}-${meta.size}"`).code(200);
273762
+ const size = meta.size;
273763
+ r.type(meta.media_type).header("content-disposition", buildContentDisposition(meta.name, meta.media_type)).header("accept-ranges", "bytes").header("etag", `"${meta.id}-${size}"`);
273764
+ const range = parseRange(readRangeHeader(req.headers["range"]), size);
273765
+ if (range) {
273766
+ r.header("content-range", `bytes ${range.start}-${range.end}/${size}`).header("content-length", range.end - range.start + 1).code(206);
273767
+ return r.send(createReadStream(blobPath, {
273768
+ start: range.start,
273769
+ end: range.end
273770
+ }));
273771
+ }
273772
+ r.header("content-length", size).code(200);
273769
273773
  return r.send(createReadStream(blobPath));
273770
273774
  } catch (err) {
273771
273775
  sendMappedError$11(reply, req.id, err);
@@ -273823,9 +273827,43 @@ function readFieldNumber(field) {
273823
273827
  if (Number.isFinite(n) && n >= 0) return Math.floor(n);
273824
273828
  }
273825
273829
  }
273826
- function buildContentDisposition(name) {
273827
- if (/^[\w. ()+[\]-]+$/.test(name)) return `attachment; filename="${name}"`;
273828
- return "attachment";
273830
+ function buildContentDisposition(name, mediaType) {
273831
+ const kind = mediaType?.split("/")[0];
273832
+ const disposition = kind === "image" || kind === "video" || kind === "audio" ? "inline" : "attachment";
273833
+ if (/^[\w. ()+[\]-]+$/.test(name)) return `${disposition}; filename="${name}"`;
273834
+ return disposition;
273835
+ }
273836
+ function readRangeHeader(value) {
273837
+ return Array.isArray(value) ? value[0] : value;
273838
+ }
273839
+ /** Parse a `Range: bytes=start-end` header against the file size. Returns
273840
+ * undefined for a missing / malformed / unsatisfiable range, in which case the
273841
+ * caller serves the whole file with 200 (browsers accept that response). */
273842
+ function parseRange(header, size) {
273843
+ if (!header || size <= 0) return void 0;
273844
+ const m = /^bytes=(\d*)-(\d*)$/i.exec(header.trim());
273845
+ if (!m) return void 0;
273846
+ const startStr = m[1];
273847
+ const endStr = m[2];
273848
+ if (startStr === "" && endStr === "") return void 0;
273849
+ let start;
273850
+ let end;
273851
+ if (startStr === "") {
273852
+ const suffix = Number(endStr);
273853
+ if (!Number.isFinite(suffix) || suffix <= 0) return void 0;
273854
+ start = Math.max(size - suffix, 0);
273855
+ end = size - 1;
273856
+ } else {
273857
+ start = Number(startStr);
273858
+ if (!Number.isFinite(start) || start < 0 || start >= size) return void 0;
273859
+ end = endStr === "" ? size - 1 : Number(endStr);
273860
+ if (!Number.isFinite(end) || end < 0) return void 0;
273861
+ }
273862
+ if (start > end) return void 0;
273863
+ return {
273864
+ start,
273865
+ end: Math.min(end, size - 1)
273866
+ };
273829
273867
  }
273830
273868
  //#endregion
273831
273869
  //#region ../../packages/server/src/lib/fileLaunch.ts
@@ -274574,7 +274612,8 @@ function registerMetaRoute(app, opts) {
274574
274612
  }),
274575
274613
  server_id: opts.serverId,
274576
274614
  started_at: opts.startedAt,
274577
- open_in_apps: [...getAvailableOpenInApps()]
274615
+ open_in_apps: [...getAvailableOpenInApps()],
274616
+ dangerous_bypass_auth: opts.dangerousBypassAuth
274578
274617
  });
274579
274618
  const route = defineRoute({
274580
274619
  method: "GET",
@@ -274918,7 +274957,7 @@ function registerPromptsRoutes(app, ix) {
274918
274957
  const promptService = a.get(IPromptService);
274919
274958
  const fileStore = a.get(IFileStore);
274920
274959
  const core = a.get(ICoreProcessService);
274921
- const resolved = await resolvePromptMediaFiles(body, fileStore, { resolveOriginalsDir: async () => {
274960
+ const resolved = await resolvePromptMediaFiles(body, fileStore, join(a.get(IEnvironmentService).homeDir, "cache"), { resolveOriginalsDir: async () => {
274922
274961
  const sessionDir = (await core.rpc.listSessions({ sessionId: session_id }))[0]?.sessionDir;
274923
274962
  return sessionDir === void 0 ? void 0 : sessionMediaOriginalsDir(sessionDir);
274924
274963
  } });
@@ -274999,7 +275038,7 @@ function registerPromptsRoutes(app, ix) {
274999
275038
  });
275000
275039
  app.post(abortRoute.path, abortRoute.options, abortRoute.handler);
275001
275040
  }
275002
- async function resolvePromptMediaFiles(body, store, options = {}) {
275041
+ async function resolvePromptMediaFiles(body, store, cacheDir, options = {}) {
275003
275042
  let changed = false;
275004
275043
  let originalsDir;
275005
275044
  let originalsDirResolved = false;
@@ -275053,6 +275092,15 @@ async function resolvePromptMediaFiles(body, store, options = {}) {
275053
275092
  }
275054
275093
  const file = await store.get(part.source.file_id);
275055
275094
  assertMediaFile(file, part.type);
275095
+ if (part.type === "video") {
275096
+ const cachePath = await materializeVideoToCache$1(file, cacheDir);
275097
+ content.push({
275098
+ type: "text",
275099
+ text: formatVideoTag(cachePath)
275100
+ });
275101
+ changed = true;
275102
+ continue;
275103
+ }
275056
275104
  const data = await readFile(file.blobPath);
275057
275105
  let mediaType = file.meta.media_type;
275058
275106
  let bytes = data;
@@ -275084,10 +275132,7 @@ async function resolvePromptMediaFiles(body, store, options = {}) {
275084
275132
  media_type: mediaType,
275085
275133
  data: Buffer.from(bytes).toString("base64")
275086
275134
  };
275087
- content.push(part.type === "video" ? {
275088
- type: "video",
275089
- source
275090
- } : {
275135
+ content.push({
275091
275136
  type: "image",
275092
275137
  source
275093
275138
  });
@@ -275098,6 +275143,34 @@ async function resolvePromptMediaFiles(body, store, options = {}) {
275098
275143
  content
275099
275144
  } : body;
275100
275145
  }
275146
+ const VIDEO_EXT_BY_MIME = {
275147
+ "video/mp4": ".mp4",
275148
+ "video/quicktime": ".mov",
275149
+ "video/webm": ".webm",
275150
+ "video/x-msvideo": ".avi",
275151
+ "video/x-matroska": ".mkv",
275152
+ "video/mpeg": ".mpeg"
275153
+ };
275154
+ async function materializeVideoToCache$1(file, cacheDir) {
275155
+ await mkdir(cacheDir, { recursive: true });
275156
+ const target = join(cacheDir, `${file.meta.id}${videoExtension(file.meta)}`);
275157
+ try {
275158
+ if ((await stat$2(target)).size === file.meta.size) return target;
275159
+ } catch {}
275160
+ await copyFile(file.blobPath, target);
275161
+ return target;
275162
+ }
275163
+ function videoExtension(meta) {
275164
+ const fromName = extname(meta.name);
275165
+ if (fromName.length > 0) return fromName;
275166
+ return VIDEO_EXT_BY_MIME[meta.media_type.toLowerCase()] ?? ".bin";
275167
+ }
275168
+ function formatVideoTag(absPath) {
275169
+ return `<video path="${escapeAttribute$2(absPath)}"></video>`;
275170
+ }
275171
+ function escapeAttribute$2(value) {
275172
+ return value.replaceAll("&", "&amp;").replaceAll("\"", "&quot;").replaceAll("<", "&lt;").replaceAll(">", "&gt;");
275173
+ }
275101
275174
  function assertMediaFile(file, expected) {
275102
275175
  const prefix = expected === "video" ? "video/" : "image/";
275103
275176
  if (file.meta.media_type.toLowerCase().startsWith(prefix)) return;
@@ -276945,7 +277018,8 @@ async function registerApiV1Routes(app, ix, opts) {
276945
277018
  registerMetaRoute(apiV1, {
276946
277019
  serverVersion: opts.serverVersion,
276947
277020
  serverId: ulid(),
276948
- startedAt: (/* @__PURE__ */ new Date()).toISOString()
277021
+ startedAt: (/* @__PURE__ */ new Date()).toISOString(),
277022
+ dangerousBypassAuth: opts.dangerousBypassAuth === true
276949
277023
  });
276950
277024
  registerAuthRoute(apiV1, ix);
276951
277025
  registerConfigRoutes(apiV1, ix);
@@ -286260,8 +286334,8 @@ var require_dist$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
286260
286334
  //#endregion
286261
286335
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/mode/static.js
286262
286336
  var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
286263
- const path$2 = __require("node:path");
286264
- const fs$1 = __require("node:fs");
286337
+ const path$3 = __require("node:path");
286338
+ const fs$2 = __require("node:fs");
286265
286339
  const yaml = require_dist$1();
286266
286340
  module.exports = function(fastify, opts, done) {
286267
286341
  if (!opts.specification) return done(/* @__PURE__ */ new Error("specification is missing in the module options"));
@@ -286270,14 +286344,14 @@ var require_static = /* @__PURE__ */ __commonJSMin(((exports, module) => {
286270
286344
  if (!opts.specification.path && !opts.specification.document) return done(/* @__PURE__ */ new Error("both specification.path and specification.document are missing, should be path to the file or swagger document spec"));
286271
286345
  else if (opts.specification.path) {
286272
286346
  if (typeof opts.specification.path !== "string") return done(/* @__PURE__ */ new Error("specification.path is not a string"));
286273
- if (!fs$1.existsSync(path$2.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
286274
- const extName = path$2.extname(opts.specification.path).toLowerCase();
286347
+ if (!fs$2.existsSync(path$3.resolve(opts.specification.path))) return done(/* @__PURE__ */ new Error(`${opts.specification.path} does not exist`));
286348
+ const extName = path$3.extname(opts.specification.path).toLowerCase();
286275
286349
  if ([".yaml", ".json"].indexOf(extName) === -1) return done(/* @__PURE__ */ new Error("specification.path extension name is not supported, should be one from ['.yaml', '.json']"));
286276
286350
  if (opts.specification.postProcessor && typeof opts.specification.postProcessor !== "function") return done(/* @__PURE__ */ new Error("specification.postProcessor should be a function"));
286277
286351
  if (opts.specification.baseDir && typeof opts.specification.baseDir !== "string") return done(/* @__PURE__ */ new Error("specification.baseDir should be string"));
286278
- if (!opts.specification.baseDir) opts.specification.baseDir = path$2.resolve(path$2.dirname(opts.specification.path));
286352
+ if (!opts.specification.baseDir) opts.specification.baseDir = path$3.resolve(path$3.dirname(opts.specification.path));
286279
286353
  else while (opts.specification.baseDir.endsWith("/")) opts.specification.baseDir = opts.specification.baseDir.slice(0, -1);
286280
- const source = fs$1.readFileSync(path$2.resolve(opts.specification.path), "utf8");
286354
+ const source = fs$2.readFileSync(path$3.resolve(opts.specification.path), "utf8");
286281
286355
  switch (extName) {
286282
286356
  case ".yaml":
286283
286357
  swaggerObject = yaml.parse(source);
@@ -286544,11 +286618,11 @@ var require_should_route_hide = /* @__PURE__ */ __commonJSMin(((exports, module)
286544
286618
  //#endregion
286545
286619
  //#region ../../node_modules/.pnpm/@fastify+swagger@9.7.0/node_modules/@fastify/swagger/lib/util/read-package-json.js
286546
286620
  var require_read_package_json = /* @__PURE__ */ __commonJSMin(((exports, module) => {
286547
- const fs = __require("node:fs");
286548
- const path$1 = __require("node:path");
286621
+ const fs$1 = __require("node:fs");
286622
+ const path$2 = __require("node:path");
286549
286623
  function readPackageJson() {
286550
286624
  try {
286551
- return JSON.parse(fs.readFileSync(path$1.join(__dirname, "..", "..", "package.json")));
286625
+ return JSON.parse(fs$1.readFileSync(path$2.join(__dirname, "..", "..", "package.json")));
286552
286626
  } catch {
286553
286627
  return {};
286554
286628
  }
@@ -287594,6 +287668,10 @@ async function startServer(opts) {
287594
287668
  bindClass
287595
287669
  }, "binding non-loopback host without TLS — use a reverse proxy or tunnel in production");
287596
287670
  }
287671
+ if (opts.dangerousBypassAuth === true) pinoLogger.warn({
287672
+ host: opts.host,
287673
+ bindClass
287674
+ }, "DANGEROUS: bearer-token auth is DISABLED (--dangerous-bypass-auth) — every REST and WebSocket route accepts unauthenticated requests");
287597
287675
  const services = createServerServiceCollection({
287598
287676
  server: {
287599
287677
  ...opts,
@@ -287604,7 +287682,8 @@ async function startServer(opts) {
287604
287682
  extra: allowedHosts,
287605
287683
  disable: isHostCheckDisabled(process.env)
287606
287684
  },
287607
- allowedOrigins: opts.wsGatewayOptions?.allowedOrigins ?? parseCorsOrigins(process.env)
287685
+ allowedOrigins: opts.wsGatewayOptions?.allowedOrigins ?? parseCorsOrigins(process.env),
287686
+ dangerousBypassAuth: opts.dangerousBypassAuth === true
287608
287687
  },
287609
287688
  serviceOverrides: [[IAuthTokenService, defaultAuth], ...opts.serviceOverrides ?? []]
287610
287689
  },
@@ -287615,7 +287694,10 @@ async function startServer(opts) {
287615
287694
  const ix = new InstantiationService(services);
287616
287695
  const authTokenService = ix.invokeFunction((a) => a.get(IAuthTokenService));
287617
287696
  const authFailureLimiter = bindClass !== "loopback" ? createAuthFailureLimiter() : void 0;
287618
- app.addHook("onRequest", createAuthHook(authTokenService, { limiter: authFailureLimiter }));
287697
+ app.addHook("onRequest", createAuthHook(authTokenService, {
287698
+ limiter: authFailureLimiter,
287699
+ disabled: opts.dangerousBypassAuth === true
287700
+ }));
287619
287701
  if (bindClass !== "loopback") app.addHook("onSend", createSecurityHeadersHook({ tls: false }));
287620
287702
  if (opts.debugEndpoints === true && bindClass !== "loopback") pinoLogger.warn({
287621
287703
  host: opts.host,
@@ -287627,7 +287709,8 @@ async function startServer(opts) {
287627
287709
  serverVersion,
287628
287710
  debugEndpoints: opts.debugEndpoints === true && bindClass === "loopback",
287629
287711
  enableShutdown: bindClass === "loopback" || allowRemoteShutdown,
287630
- enableTerminals: bindClass === "loopback" || allowRemoteTerminals
287712
+ enableTerminals: bindClass === "loopback" || allowRemoteTerminals,
287713
+ dangerousBypassAuth: opts.dangerousBypassAuth === true
287631
287714
  });
287632
287715
  app.get("/asyncapi.json", async (_req, reply) => {
287633
287716
  return reply.type("application/json").send(createAsyncApiDocument({
@@ -287943,15 +288026,20 @@ const VALID_LOG_LEVELS = [
287943
288026
  "silent"
287944
288027
  ];
287945
288028
  function parseServerOptions(opts) {
288029
+ const host = parseHost(opts.host);
288030
+ const allowedHosts = parseAllowedHostArgs(opts.allowedHost);
288031
+ const keepAlive = opts.keepAlive === true || host !== "127.0.0.1" || allowedHosts.length > 0;
287946
288032
  return {
287947
- host: parseHost(opts.host),
288033
+ host,
287948
288034
  port: parsePort(opts.port, "--port", DEFAULT_SERVER_PORT),
287949
288035
  logLevel: parseLogLevel(opts.logLevel ?? "silent"),
287950
288036
  debugEndpoints: opts.debugEndpoints === true,
287951
288037
  insecureNoTls: opts.insecureNoTls !== false,
287952
288038
  allowRemoteShutdown: opts.allowRemoteShutdown === true,
287953
288039
  allowRemoteTerminals: opts.allowRemoteTerminals === true,
287954
- allowedHosts: parseAllowedHostArgs(opts.allowedHost),
288040
+ dangerousBypassAuth: opts.dangerousBypassAuth === true,
288041
+ allowedHosts,
288042
+ keepAlive,
287955
288043
  daemon: opts.daemon === true,
287956
288044
  idleGraceMs: parseIdleGraceMs(opts.idleGraceMs)
287957
288045
  };
@@ -288179,6 +288267,8 @@ function spawnDaemonChild(options) {
288179
288267
  if (options.insecureNoTls === true) args.push("--insecure-no-tls");
288180
288268
  if (options.allowRemoteShutdown === true) args.push("--allow-remote-shutdown");
288181
288269
  if (options.allowRemoteTerminals === true) args.push("--allow-remote-terminals");
288270
+ if (options.dangerousBypassAuth === true) args.push("--dangerous-bypass-auth");
288271
+ if (options.keepAlive === true) args.push("--keep-alive");
288182
288272
  if (options.idleGraceMs !== void 0) args.push("--idle-grace-ms", String(options.idleGraceMs));
288183
288273
  if (options.allowedHosts !== void 0 && options.allowedHosts.length > 0) args.push("--allowed-host", ...options.allowedHosts);
288184
288274
  const execPath = process.execPath;
@@ -288237,6 +288327,8 @@ async function ensureDaemon(options = {}) {
288237
288327
  insecureNoTls: options.insecureNoTls,
288238
288328
  allowRemoteShutdown: options.allowRemoteShutdown,
288239
288329
  allowRemoteTerminals: options.allowRemoteTerminals,
288330
+ dangerousBypassAuth: options.dangerousBypassAuth,
288331
+ keepAlive: options.keepAlive,
288240
288332
  allowedHosts: options.allowedHosts,
288241
288333
  idleGraceMs: options.idleGraceMs
288242
288334
  });
@@ -288956,7 +289048,7 @@ function buildWebUrl(origin, token) {
288956
289048
  }
288957
289049
  /** Build the `run` subcommand, mounted under a parent (`server` or top-level). */
288958
289050
  function buildRunCommand(cmd, options) {
288959
- return cmd.option("--port <port>", `Bind port (default ${DEFAULT_SERVER_PORT})`, String(DEFAULT_SERVER_PORT)).option("--host [host]", `Bind host. Omit to bind ${DEFAULT_SERVER_HOST} (this machine only); pass --host to bind ${DEFAULT_LAN_HOST} (all interfaces), or --host <host> for a specific host. The bearer token is printed at startup.`).option("--allowed-host <host...>", "Extra Host header value to allow through the DNS-rebinding check. Repeat or comma-separate; a leading dot matches a domain suffix (e.g. .example.com).").option("--insecure-no-tls", "Allow a non-loopback bind without a TLS-terminating reverse proxy. Defaults to true; only relevant for non-loopback binds.", true).option("--allow-remote-shutdown", "On a non-loopback bind, keep POST /api/v1/shutdown enabled (default: route is disabled → 404).", false).option("--allow-remote-terminals", "On a non-loopback bind, keep the PTY /api/v1/terminals/* routes enabled (default: disabled → 404). Remote shell is high risk.", false).option("--log-level <level>", `Server log level: ${VALID_LOG_LEVELS.join("|")}. Omit to keep logs off.`).option("--debug-endpoints", "Mount /api/v1/debug/* routes for test introspection. OFF by default; production callers leave this unset.", false).option("--foreground", "Run the server in the foreground and keep this terminal attached until SIGINT/SIGTERM (do not daemonize).", false).option(options.defaultOpen ? "--no-open" : "--open", options.defaultOpen ? "Do not open the web UI in the default browser." : "Open the web UI in the default browser once the server is healthy.", options.defaultOpen).addOption(new Option("--daemon", "Run as an idle-exiting background daemon (internal).").hideHelp()).addOption(new Option("--idle-grace-ms <ms>", "Idle-shutdown grace in ms (daemon mode, internal).").hideHelp()).action(async (opts) => {
289051
+ return cmd.option("--port <port>", `Bind port (default ${DEFAULT_SERVER_PORT})`, String(DEFAULT_SERVER_PORT)).option("--host [host]", `Bind host. Omit to bind ${DEFAULT_SERVER_HOST} (this machine only); pass --host to bind ${DEFAULT_LAN_HOST} (all interfaces), or --host <host> for a specific host. The bearer token is printed at startup.`).option("--allowed-host <host...>", "Extra Host header value to allow through the DNS-rebinding check. Repeat or comma-separate; a leading dot matches a domain suffix (e.g. .example.com).").option("--keep-alive", "Keep the server running instead of exiting after 60s with no connected clients. Implied automatically by --host / --allowed-host, and always on in --foreground mode.", false).option("--insecure-no-tls", "Allow a non-loopback bind without a TLS-terminating reverse proxy. Defaults to true; only relevant for non-loopback binds.", true).option("--allow-remote-shutdown", "On a non-loopback bind, keep POST /api/v1/shutdown enabled (default: route is disabled → 404).", false).option("--allow-remote-terminals", "On a non-loopback bind, keep the PTY /api/v1/terminals/* routes enabled (default: disabled → 404). Remote shell is high risk.", false).option("--dangerous-bypass-auth", "Disable bearer-token auth on every REST and WebSocket route, and advertise it via /api/v1/meta so the web UI connects without a token. Only use on a trusted network or behind your own authenticating proxy.", false).option("--log-level <level>", `Server log level: ${VALID_LOG_LEVELS.join("|")}. Omit to keep logs off.`).option("--debug-endpoints", "Mount /api/v1/debug/* routes for test introspection. OFF by default; production callers leave this unset.", false).option("--foreground", "Run the server in the foreground and keep this terminal attached until SIGINT/SIGTERM (do not daemonize).", false).option(options.defaultOpen ? "--no-open" : "--open", options.defaultOpen ? "Do not open the web UI in the default browser." : "Open the web UI in the default browser once the server is healthy.", options.defaultOpen).addOption(new Option("--daemon", "Run as an idle-exiting background daemon (internal).").hideHelp()).addOption(new Option("--idle-grace-ms <ms>", "Idle-shutdown grace in ms (daemon mode, internal).").hideHelp()).action(async (opts) => {
288960
289052
  try {
288961
289053
  await handleRunCommand(opts);
288962
289054
  } catch (error) {
@@ -288971,21 +289063,27 @@ async function handleRunCommand(opts, deps = DEFAULT_RUN_COMMAND_DEPS) {
288971
289063
  await startServerDaemon(parsed);
288972
289064
  return;
288973
289065
  }
289066
+ const runOptions = opts.foreground === true ? {
289067
+ ...parsed,
289068
+ keepAlive: true
289069
+ } : parsed;
288974
289070
  const writeReady = (result) => {
288975
289071
  const { origin } = result;
288976
289072
  const host = result.host ?? parsed.host;
288977
- const token = deps.resolveToken?.();
289073
+ const effectiveBypass = result.reused === true ? false : parsed.dangerousBypassAuth;
289074
+ const token = effectiveBypass ? void 0 : deps.resolveToken?.();
288978
289075
  let output = "";
288979
289076
  if (result.reused === true) output += formatReuseNotice(origin);
288980
289077
  output += parsed.logLevel === "silent" ? formatReadyBanner(origin, host, {
288981
289078
  token,
288982
- networkAddresses: deps.networkAddresses
288983
- }) : formatReadyLine(origin, token);
289079
+ networkAddresses: deps.networkAddresses,
289080
+ dangerousBypassAuth: effectiveBypass
289081
+ }) : formatReadyLine(origin, token, effectiveBypass);
288984
289082
  deps.stdout.write(output);
288985
289083
  if (opts.open === true) deps.openUrl(token !== void 0 ? buildWebUrl(origin, token) : origin);
288986
289084
  };
288987
289085
  if (opts.foreground === true) {
288988
- await (deps.startServerForeground ?? startServerForeground)(parsed, { onReady: (origin) => {
289086
+ await (deps.startServerForeground ?? startServerForeground)(runOptions, { onReady: (origin) => {
288989
289087
  writeReady({
288990
289088
  origin,
288991
289089
  reused: false,
@@ -288994,13 +289092,27 @@ async function handleRunCommand(opts, deps = DEFAULT_RUN_COMMAND_DEPS) {
288994
289092
  } });
288995
289093
  return;
288996
289094
  }
288997
- writeReady(await deps.startServerBackground(parsed));
289095
+ writeReady(await deps.startServerBackground(runOptions));
288998
289096
  }
288999
289097
  function formatReuseNotice(origin) {
289000
289098
  return `${chalk.hex(darkColors.warning)("A server is already running")} at ${origin} — the options from this command were not applied. Run ${chalk.bold("kimi server kill")} first to bind a new host/port.\n`;
289001
289099
  }
289002
- function formatReadyLine(origin, token) {
289003
- return `Kimi server: ${buildOpenableUrl(origin, token)}\n`;
289100
+ function formatReadyLine(origin, token, dangerousBypassAuth = false) {
289101
+ return `${dangerousBypassAuth ? `${formatDangerNoticeLines().join("\n")}\n` : ""}Kimi server: ${buildOpenableUrl(origin, token)}\n`;
289102
+ }
289103
+ /**
289104
+ * Red, impossible-to-miss notice emitted when `--dangerous-bypass-auth`
289105
+ * disables the bearer-token gate. Shared by the full ready banner and the
289106
+ * compact one-line output so the warning always shows regardless of log level.
289107
+ */
289108
+ function formatDangerNoticeLines() {
289109
+ const danger = (text) => chalk.hex(darkColors.error)(text);
289110
+ const dangerBold = (text) => chalk.bold.hex(darkColors.error)(text);
289111
+ return [
289112
+ ` ${dangerBold("⚠ DANGER: authentication is DISABLED (--dangerous-bypass-auth).")}`,
289113
+ ` ${danger("Anyone who can reach this port gets full access. Only continue if you understand the risk.")}`,
289114
+ ` ${danger(`If you are unsure, run `)}${dangerBold("kimi server kill")}${danger(" now to stop this process.")}`
289115
+ ];
289004
289116
  }
289005
289117
  /**
289006
289118
  * `kimi server run` (non-daemon) — ensures a background daemon is running
@@ -289017,6 +289129,8 @@ async function startServerBackground(options) {
289017
289129
  insecureNoTls: options.insecureNoTls,
289018
289130
  allowRemoteShutdown: options.allowRemoteShutdown,
289019
289131
  allowRemoteTerminals: options.allowRemoteTerminals,
289132
+ dangerousBypassAuth: options.dangerousBypassAuth,
289133
+ keepAlive: options.keepAlive,
289020
289134
  allowedHosts: options.allowedHosts,
289021
289135
  idleGraceMs: options.idleGraceMs
289022
289136
  });
@@ -289050,7 +289164,7 @@ async function runServerInProcess(options, mode, onReady) {
289050
289164
  const telemetry = initializeServerTelemetry({ version });
289051
289165
  let running;
289052
289166
  let stopping = false;
289053
- const idle = mode.daemon ? createIdleShutdownHandler({
289167
+ const idle = mode.daemon && !options.keepAlive ? createIdleShutdownHandler({
289054
289168
  graceMs: options.idleGraceMs,
289055
289169
  onIdle: () => {
289056
289170
  shutdown("idle");
@@ -289077,6 +289191,7 @@ async function runServerInProcess(options, mode, onReady) {
289077
289191
  insecureNoTls: options.insecureNoTls,
289078
289192
  allowRemoteShutdown: options.allowRemoteShutdown,
289079
289193
  allowRemoteTerminals: options.allowRemoteTerminals,
289194
+ dangerousBypassAuth: options.dangerousBypassAuth,
289080
289195
  allowedHosts: options.allowedHosts,
289081
289196
  webAssetsDir: serverWebAssetsDir(),
289082
289197
  coreProcessOptions: {
@@ -289097,7 +289212,10 @@ async function runServerInProcess(options, mode, onReady) {
289097
289212
  process.once("SIGTERM", () => {
289098
289213
  shutdown("SIGTERM");
289099
289214
  });
289100
- const readyFields = mode.daemon ? {
289215
+ const readyFields = mode.daemon ? options.keepAlive ? {
289216
+ address: running.address,
289217
+ idleShutdown: "disabled"
289218
+ } : {
289101
289219
  address: running.address,
289102
289220
  idleGraceMs: options.idleGraceMs
289103
289221
  } : { address: running.address };
@@ -289163,6 +289281,7 @@ function formatReadyBanner(origin, host, opts = {}) {
289163
289281
  ` ${primary(logo[1])} ${dim("Local web UI is available from this machine.")}`,
289164
289282
  ""
289165
289283
  ];
289284
+ if (opts.dangerousBypassAuth === true) lines.push(...formatDangerNoticeLines(), "");
289166
289285
  for (const { label: text, url: href } of accessUrlLines(host, port, opts.token, opts.networkAddresses)) lines.push(` ${label(text)}${urlWithDimToken(href)}`);
289167
289286
  if (isLoopbackHost$1(host)) lines.push(` ${label("Network: ")}${muted("off")}${dim(" use --host to enable")}`);
289168
289287
  if (opts.token !== void 0) {
@@ -367088,7 +367207,8 @@ async function resolvePromptSession(harness, opts, workDir, defaultModel, stderr
367088
367207
  workDir,
367089
367208
  model,
367090
367209
  permission: "auto",
367091
- additionalDirs: opts.addDirs?.length ? opts.addDirs : void 0
367210
+ additionalDirs: opts.addDirs?.length ? opts.addDirs : void 0,
367211
+ drainAgentTasksOnStop: true
367092
367212
  });
367093
367213
  installHeadlessHandlers(session);
367094
367214
  return {
@@ -378077,6 +378197,24 @@ function basenameLike(raw) {
378077
378197
  }
378078
378198
  //#endregion
378079
378199
  //#region src/tui/utils/image-placeholder.ts
378200
+ /**
378201
+ * Scan submitted text for media placeholders and produce
378202
+ * the `PromptPart[]` we'll send to the SDK prompt endpoint.
378203
+ *
378204
+ * Rules:
378205
+ * - Only placeholders that resolve against `store` get extracted.
378206
+ * A literal `[image #999 ...]` the user typed themselves stays in
378207
+ * the text (we can't hallucinate files for it).
378208
+ * - Order is preserved for text/image/video segments. Image placeholders
378209
+ * expand to image content parts so the prompt reaches the provider
378210
+ * without relying on a model tool call. Video placeholders are copied
378211
+ * into the shared cache (`getCacheDir()`) and expand to file-path tags,
378212
+ * so `ReadMediaFile` — and the provider's `VideoUploader` — own video
378213
+ * upload behavior instead of base64-inlining here.
378214
+ * - Adjacent text segments are flattened — empty / whitespace-only
378215
+ * segments drop out so we never emit `{type:'text', text:' '}`
378216
+ * noise between two media parts.
378217
+ */
378080
378218
  const PLACEHOLDER_REGEX = /\[(image|video) #(\d+) (?:(\(\d+×\d+\))|([^\]]+))\]/g;
378081
378219
  function extractMediaAttachments(text, store) {
378082
378220
  const parts = [];
@@ -378096,7 +378234,7 @@ function extractMediaAttachments(text, store) {
378096
378234
  if (attachment.kind !== kind) continue;
378097
378235
  pushText(parts, text.slice(cursor, match.index));
378098
378236
  if (attachment.kind === "video") {
378099
- pushText(parts, tagTextForVideo(attachment));
378237
+ pushText(parts, formatMediaTag("video", materializeVideoToCache(attachment)));
378100
378238
  videoAttachmentIds.push(id);
378101
378239
  } else {
378102
378240
  if (attachment.original !== void 0) pushText(parts, captionForCompressedImage(attachment));
@@ -378137,6 +378275,13 @@ function imagePartForAttachment(att) {
378137
378275
  imageUrl: { url: `data:${att.mime};base64,${base64}` }
378138
378276
  };
378139
378277
  }
378278
+ function materializeVideoToCache(att) {
378279
+ const cacheDir = getCacheDir();
378280
+ mkdirSync(cacheDir, { recursive: true });
378281
+ const target = join(cacheDir, `${randomUUID()}-${att.label}`);
378282
+ copyFileSync(att.sourcePath, target);
378283
+ return target;
378284
+ }
378140
378285
  function captionForCompressedImage(att) {
378141
378286
  const original = att.original;
378142
378287
  if (original === void 0) return "";
@@ -378156,9 +378301,6 @@ function captionForCompressedImage(att) {
378156
378301
  originalPath: original.path
378157
378302
  });
378158
378303
  }
378159
- function tagTextForVideo(att) {
378160
- return formatMediaTag("video", att.sourcePath);
378161
- }
378162
378304
  function formatMediaTag(tag, path) {
378163
378305
  return `<${tag} path="${escapeAttribute(path)}"></${tag}>`;
378164
378306
  }